Skip to main content

What to do when .gitignore doesn't

Posted on: Wednesday, 12 October 2011 @ 10:32am
Blatting about
More specifically

So.  At work we've switched from using svn to git (and GitHub).

Difference: decentralised, therefore "commit" commits it to the local repo rather than the remote/centralised one, and you have to "commit" then "push" to the remote.

Problem: .gitignore was not gitignoring some files (settings.php and .htaccess which I had to change to make it work on my local) which it was supposed to be gitignoring.

Solution as per RobWilkerson.org:

Do:

git status

which should spit up a list of modified files since lasy commit/sync/something (shut up I'm still working git out ;)

Next:

git update-index --assume-unchanged path/to/file

Yay, can now sync!

And for a listing of what's --assume-unchanged:

git ls-files -v | grep -e "^[hsmrck]"

Thank you Rob Wilkerson :)

No comments yet

Tahsin Hasan Saturday, 11 August 2012 @ 2:18pm [Permalink]
nice writing. but .gitignore may not work. see the fix at <a href="http://newdailyblog.blogspot.com/2012/08/gitignore-file-not-working.html">tahSin's gaRage</a>.
bek Saturday, 11 August 2012 @ 2:36pm [Permalink]

Add new comment

The content of this field is kept private and will not be shown publicly.