Skip to content

Instantly share code, notes, and snippets.

@tompazourek
Forked from tqheel/commit-config.sh
Last active April 15, 2020 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tompazourek/43708221b71c7a710510 to your computer and use it in GitHub Desktop.
Save tompazourek/43708221b71c7a710510 to your computer and use it in GitHub Desktop.
Prevent ASP.Net Web.Config From Being Committed By Git
#Run this to reverse ignoring of changes to web.config so it gets committed.
git update-index --no-assume-unchanged path_to_file/web.config
#This command works more consistently for me. It will print only the files that are listed as 'assume-unchanged'.
#http://stackoverflow.com/a/29662774/108374
git ls-files -v|grep '^h'
#Run this in GitBash to temporarily ignore changes to web.config so it does not get committed.
git update-index --assume-unchanged path_to_file/web.config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment