4

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.

5

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.

1
  • 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 ;)
    – RichieHH
    Jan 1 at 9:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.