2

I have some file extensions ignored in my .gitignore. I'd like to force-stage a particular one of them.

Given the C-g magit buffer, how can I get a view that ignores my .gitignore so that I can identify and force stage the single file I'd like to commit?

Mittenchops
  • 18,633
  • 33
  • 128
  • 246

1 Answers1

2

A few alternatives:

  • Since Magit 2.13, if you add magit-insert-ignored-files to C-hv magit-status-sections-hook and refresh the status buffer, you'll see all the ignored files in a separate collapsible section, and can act on them from there.

  • Delete .gitignore (maybe within Magit via !s), refresh the status buffer if necessary, stage what you want to stage, and then tell Magit to revert the deleted .gitignore.

  • Use : (or a terminal) to run the git add command manually, rather than using the Magit UI.

phils
  • 71,335
  • 11
  • 153
  • 198