简体   繁体   English

从tig检出文件

[英]Checkout a file from tig

If i open up tig with another branch: 如果我用另一个分支打开tig:

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? 是否可以导航到树视图中找到我想要的文件并将其签出到当前分支?

Yes, you have to add a user-defined command in ~/.tigrc , for example: 是的,您必须在~/.tigrc添加用户定义的命令,例如:

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 . 然后打开tig otherBranch ,按t转到树视图,导航到文件,然后按Ctrl-F

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM