git checkout revision of a file in git gui

妖精的绣舞 提交于 2019-12-07 06:53:36

问题


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?


回答1:


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


来源:https://stackoverflow.com/questions/1507300/git-checkout-revision-of-a-file-in-git-gui

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!