I'm trying out Magit for a monstrously large monorepo at work (think millions of lines of code) and there are many untracked build artifacts. From my shell I always use git status -uno to avoid having git try to unenumerate all of the artifacts that should be ignored but aren't.

I wish I could just add things to the .gitignore files, but sadly this is just not feasible (layer 8 problem in the networking stack...).

Can I configure magit to not interact with untracked files at all when refreshing?

I found this question, but I don't want to just hide the untracked section, but avoid the mega latency from git attempting to enumerate the thousands of untracked files (that I don't care about).

  • Can't you just modify .gitignore in your own local branch? – loris May 11 '20 at 9:31

If telling git to ignore those untracked files to .gitignore would solve your problem, then do that. You can't modify the .gitignore files, ok, so use another method:

  • .git/info/exclude (same effect as .gitignore at the root, except that it only applies in this working tree).
  • ~/.config/git/ignore (same effect as .gitignore at the root, except that it applies to all your working trees).
  • This effectively solves my problem (borrowing someone else's gitignore file from within the company). Thanks! – Sam Whitlock May 11 '20 at 13:25

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.