Search code examples
tig

Checkout a file from 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?


Solution

  • 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.