git - 获取中间提交

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5819519/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 05:23:08  来源:igfitidea点击:

git - fetch an intermediate commit

git

提问by pengguang001

Is there any git command to fetch an intermediate commit, just like 'svn co -r xxx' works? Thanks!

是否有任何 git 命令来获取中间提交,就像 'svn co -r xxx' 一样工作?谢谢!

回答by CharlesB

git checkout <commit-id>, where <commit-id>is the SHA1 of a commit, a tag, or a branch.

git checkout <commit-id>,其中<commit-id>是提交、标签或分支的 SHA1。

Note that in git vocabulary, fetchrefers to connecting to a remote repository and grabbing its commits.

请注意,在 git 词汇中,fetch指的是连接到远程存储库并获取其提交。