Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Checkout a file from tig

Tags:

tig

If i open up tig with another branch:

tig otherBranch

Is it possible to navigate to the tree view find a file that I want and check it out to my current branch?

like image 497
Allan Hortle Avatar asked Oct 14 '25 19:10

Allan Hortle


1 Answers

Yes, you have to add a user-defined command in ~/.tigrc, for example:

bind generic ^F !?git checkout %(commit) %(file)

Then open tig otherBranch, press t to go to the tree view, navigate to the file and press Ctrl-F.

like image 134
Jonas Fonseca Avatar answered Oct 18 '25 09:10

Jonas Fonseca



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!