Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

up vote 2 down vote accepted

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

adding

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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