22 August 20251 min read

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

Terminal window
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:

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

  • ❗️ 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.

  • 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, considerbuying me a coffee
No CopyrightCC0 1.0