Temporarily ignore changes

During development it’s convenient to stop tracking file changes to a file committed into your git repo. This is very convenient when customizing settings or configuration files that are part of your project source for your own work environment.

git update-index --assume-unchanged <file>

Resume tracking files with:

git update-index --no-assume-unchanged <file>

Permanently ignore changes to a file

If a file is already tracked by Git, adding that file to your .gitignore is not enough to ignore changes to the file. You also need to remove the information about the file from Git’s index:

These steps will not delete the file from your system. They just tell Git to ignore future updates to the file.

  1. Add the file in your .gitignore.
  2. Run the following:
    git rm --cached <file>
  3. Commit the removal of the file and the updated .gitignore to your repo.

(Source docs.microsoft.com/en-us/vsts/repos/git/ignore-files)

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.