Git pull 没有拉取最新版本
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13338107/
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
Git pull not pulling the latest revision
提问by Ram
We use Github for source control in our organization. Multiple developers continuously merge their changes to remote source repository. In my case I cloned the repository when two weeks back and there were multiple merges after that. Now I am trying to get the latest revision of the code using.
我们在组织中使用 Github 进行源代码控制。多个开发人员不断将他们的更改合并到远程源存储库。就我而言,我在两周前克隆了存储库,之后进行了多次合并。现在我正在尝试使用最新版本的代码。
git pull origin master
I for sure know that there were multiple merges that have gone in since last time I cloned but pull command tells me that its already up to date. Am I missing anything here?
我肯定知道自从我上次克隆以来已经进行了多次合并,但是 pull 命令告诉我它已经是最新的。我在这里错过了什么吗?
回答by joel3000
git reset --hard HEAD~20 # some large number
git pull origin master
This fixed my problem with an un-pullable update. The idea is to push HEAD back far enough to clear up any confusion for git. Then make the desired pull.
这通过不可拉取的更新解决了我的问题。这个想法是将 HEAD 推回足够远,以消除 git 的任何混淆。然后进行所需的拉动。
回答by VonC
One explanation would be that the latest commits have been done on another branch, as explained in "Git pull from my public repository not working".
一种解释是最新的提交是在另一个分支上完成的,如“ Git pull from my public repository not working”中所述。
The other possibility is for you to be in a detached HEADmode.
That would make any git pull
"up-to-date" since you are in any branch.
另一种可能性是您处于分离的 HEAD模式。
这将使任何git pull
“最新”,因为您在任何分支。
回答by Tien
I used Team Explorer from my Visual Studio application and was able to Sync, Fetch, and Pull. That finally worked.
我在 Visual Studio 应用程序中使用了团队资源管理器,并且能够同步、获取和拉取。这终于奏效了。