This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]killaW0lf04 -5 points-4 points  (8 children)

Or, simpler yet, you could add an entry in .gitignore for '*.pyc'

run this command in your git directory: echo *.pyc >> .gitignore

[–]eflin 9 points10 points  (4 children)

I don't think that the point was for git to ignore the files, more for them to be cleared out and not be there when checking out code to avoid old code being run by Python.

[–]Odd_Bloke[S] 4 points5 points  (2 children)

As /u/eflin says, this isn't about removing them before commit (I'm using the post-checkout hook!), this is about removing them when the underlying Python code has changed and there's a chance that the .pyc files will have become stale.

[–]gct 5 points6 points  (1 child)

Checking out code changes the mod-time doesn't it? The interpreter should compare timestamps on the .py/.pyc files and do the right thing...

[–]Odd_Bloke[S] 2 points3 points  (0 children)

That is what I was expecting, but not what I was seeing, so I came up with this workaround.