What to do when .gitignore doesn't
posted on: Wednesday, 12 October 2011 @ 10:32am inSo. 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 :)
This work is marked with CC0 1.0 Universal