git pull from remote...我可以拉一个特定的提交吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16795813/
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-10 16:15:59  来源:igfitidea点击:

git pull from remote... can I pull a specific commit?

gitgithubfetchpull

提问by basZero

I create an empty new repository locally, I add a remote repository. Now I want to get a specific commit from the remote repository without downloading the whole remote repository with all its branches!

我在本地创建了一个空的新存储库,我添加了一个远程存储库。现在我想从远程存储库中获取特定提交,而无需下载整个远程存储库及其所有分支!

How do I do that?

我怎么做?

采纳答案by basZero

Answer is

答案是

git fetch origin 96de5297df870:refs/remotes/origin/D-commit

See Retrieve specific commit from a remote Git repository

请参阅从远程 Git 存储库检索特定提交