mark |
Post a Comment |
Friday, October 21, 2011 at 8:18AM Here are a couple of quick tips for dealing with ignoring files in GIT. It has saved me a lot of headaches so I am documenting them here for posterity's sake.
You can easily ignore files if they have not been previously added to the GIT repository by adding it to the .git/info/exclude file. This is extremely useful when you want to exclude text editor specific files, windows thumbnail files but do not want to include it in the main repository .gitignore file.
# git ls-files --others --exclude-from=.git/info/exclude # Lines that start with '#' are comments. # For a project mostly in C, the following would be a good set of # exclude patterns (uncomment them if you want to use them): *.[oa] *~ *.tmproj
This method is useful for when you need to maintain local changes to a file but do not want to accidentally push those changes to the main GIT Repository.
mb2:~ mark$ git update-index --assume-unchanged loc/of/file
mark |
Post a Comment |
Reader Comments