Skip to content

Instantly share code, notes, and snippets.

@yvzkr
Forked from tompazourek/commit-config.sh
Created April 15, 2020 13:59
Show Gist options
  • Save yvzkr/945d20e0ec39b682e4975826ec5f4f46 to your computer and use it in GitHub Desktop.
Save yvzkr/945d20e0ec39b682e4975826ec5f4f46 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
@yvzkr
Copy link
Author

yvzkr commented Apr 15, 2020

#Delete this seetings
git update-index --really-refresh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment