Skip to content

Instantly share code, notes, and snippets.

@DannyDelott
Created January 1, 2016 03:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DannyDelott/5767e3083fd0cdce7226 to your computer and use it in GitHub Desktop.
Save DannyDelott/5767e3083fd0cdce7226 to your computer and use it in GitHub Desktop.
how to ignore tracked files
Source: http://stackoverflow.com/questions/10879783/git-doesnt-ignore-2-specifically-named-files/10881296#comment14178464_10879783
What you want to is to ignore changes on tracked files. This cannot achieved (as Charles Bailey says) correctly, neither with .gitignore nor with .git/info/exclude.
You'll need to use git update-index:
git update-index --assume-unchanged build/conf/a.conf
git update-index --assume-unchanged build/conf/b.conf
will achieve what you want: the files are always assumed unchanged.
If you want to track changes in these files again, use --no-assume-unchanged.
Finally, if you want to know which files are currently in the --assume-unchanged mode, ask git for
git ls-files -v | grep -e "^[hsmrck]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment