在git gui中使用git checkout修改文件 [英] git checkout revision of a file in git gui
本文介绍了在git gui中使用git checkout修改文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
尝试添加新工具:
git checkout $ REVISION $ FILENAME
但它只允许分支修订版本,而不是特定的提交。有没有一个特定的变种我coud用来做到这一点?
解决方案
您可以尝试:
$ git show $ REVISION:$ FILENAME
<如 git rev-parse
。
如果您可以指定 $ FILENAME
相对于项目顶部目录(包括 .git
目录的目录)的完整路径。
这应该相当于:
$ git checkout $ REVISION - $ FILENAME
Is there a good way to checkout revisions of a specific file in git gui like an add tool or something?
Tried adding a new tool as:
git checkout $REVISION $FILENAME
But it only allows branch revisions out, not a specific commit. Is there a particular var I coud use to do that?
解决方案
You could try:
$ git show $REVISION:$FILENAME
with a ':' syntax as described in git rev-parse
.
That would be if you can specify for $FILENAME
the full path relative to the top directory of your project (the directory including the .git
directory).
This should be equivalent to:
$ git checkout $REVISION -- $FILENAME
这篇关于在git gui中使用git checkout修改文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文