I am working on a project where webpack
's bundle.js
is part of the repository. This file is gigantic and has many diffs and slows magit down. Is there a way I can tell magit to ignore this file when computing unstaged changes? To reiterate, I don't want to untrack the file or add it to my .gitignore, I just want magit to ignore it.
1 Answer
You can tell git
to temporarily ignore changes to a certain file using:
git update-index --assume-unchanged <file>
and later you can undo that using:
git update-index --no-assume-unchanged <file>
Magit will respect that setting too.
-
Can I tell magit to ignore a "noisy" auto-generated file like readme.md which is an org-mode report? I want it in git so it's pushed to GitHub but unfortunately, org regenerates all its internal IDs when exporting to markdown and that makes a lot of noise in git status ;)– RichieHHJan 1, 2021 at 9:11