git temporarily ignore local files

The file exists in the repository, but you don't want to submit it every time you modify it (such files are generally files related to the local development environment), you can do this:

1. Open the .git/config file

2. Increase 

[alias]

ignore = update-index --assume-unchanged

unignore = update-index --no-assume-unchanged

ignored = !git ls-files -v | grep "^[[:lower:]]"

3. Run git ignore filename

 

This way, the changes to this file will not be committed when you commit again. If you need to submit this file again, run 

git unignore filename

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326806087&siteId=291194637