Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I often use tig to select which modifications to add, and which to commit. I scroll via the patches, push u to add, and when I am satisfied, I press C to commit the added changes.

Every once in a while I miss a file that I wished to commit together with the last commit. Currently what I am doing is as follows:

  • look for the modification I have missed
  • press u to add it
  • exit tig
  • type git amend
  • save the same commit message
  • enter tig once again

Is there a way to define some shortcut, such as a (which currently returns Unknown key, press 'h' for help), that will do that process and stay in tig?

share|improve this question
up vote 2 down vote accepted

You can provide custom bindings to tig in your ~/.tigrc


bind status a !?git commit --amend

gives you to use 'a' key to amend the previous commit while you are in the status view.

extra explanation of command:

  • the '!' defines that it is an external command
  • the '?' makes sure that it confirms the command before it's run

the rest is self explanatory.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .