Temporarily Ignore Local Changes to a Tracked File in Git · Hua-Ming Huang
My Profile Image
written by Hua-Ming Huang
August 22, 2025 1 minute read
temporarily-ignore-local-changes-to-a-tracked-file-in-git

Today I learned that you can tell Git to temporarily ignore changes to a tracked file using:

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

After this, Git won’t show changes to the file in git status, git add, or git commit.

To start tracking changes again:

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

Caution

  • ❗️ If the file is modified in the remote branch and you pull, Git may overwrite your local changes.
  • ❗️ This is only for temporary local changes; the file remains tracked in the repository. This is mainly an optimization for large repositories, as Git will skip checking the file for changes, speeding up status and diff.

Side Notes

  • This is mainly an optimization for large repositories, as Git will skip checking the file for changes, speeding up status and diff.
Email Me
Thanks for reading! If you found this page useful, consider buying me a coffee
© 2026 Hua-Ming Huang · licensed under CC BY 4.0