Git 拉取中止
我的同事将生产修补程序的一些更改合并到他的本地 master 分支中,然后将 master 推送到我们的 GitHub 存储库。现在我尝试用他的更改更新我的本地主分支。当从 git 控制台执行“git pull origin”时,显示所有文件似乎一切顺利。但是,接近尾声时,它只是停止并显示“正在中止”消息。
我不知道下一步该做什么。帮助?
更新: 这样问题就解决了。问题的真正根源是我的同事从他的分支中的 .gitignore 文件中删除了一些条目,这允许几个新文件进入他的签入。由于我的本地 .gitignore 仍然忽略这些文件,因此我的本地存储库认为我没有本地工作文件可以添加到索引中。我最终删除了所有文件,然后拉动起作用并将它们全部带入。
我肯定会更加小心地编辑 .gitignore 文件并将其签入。现在我对它对其他开发人员的影响有了一些新的认识。
My colleague merged some change for a production hotfix into his local master branch and then did a push of master to our GitHub repository. Now I'm try to update my local master branch with his changes. When a do a "git pull origin" from the git console it seems like it going fine by showing all the files. But, near the end it just stops with the message "Aborting".
I have no idea what to do next. Help?
UPDATE:
So problem solved. The real root of the problem was that my colleague removed some entries from the .gitignore file in his branch that allowed several new files to come into his checkin. Since my local .gitignore was still ignoring those files, my local repo didn't think I had local working files to add to the index. I ended up deleting all the files and then the pull worked and brought them all in.
I'm definitely going to be more careful editing the .gitignore file and checking it in. I now have some new appreciation for its affect on other developers.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
他可能将提交放在现有提交树中的某个位置,而不是放在其顶部。
试试这个:
如果这不起作用,只需创建一个
origin
的本地分支,挑选你的本地提交到它上面,在他合并的任何提交之前重置 master,然后将你的本地分支合并到掌握。我的猜测是,他的推送在某个时刻涉及了
--force
以避免出现not a fast-forward commit
消息。将来你不想这样做。He probably put the commit somewhere in the existing commit tree, rather than on top of it.
Try this:
And if that doesn't work, just create a local branch of
origin
, cherry-pick your local commits onto it, reset master before whatever commit he merged, and then merge your local branch onto master.My guess is that his push involved a
--force
at some point to avoid anot a fast-forward commit
message. You don't want to do that, in the future.问题的根源是我的同事从他的分支中的 .gitignore 文件中删除了一些条目,从而允许多个新文件进入他的签入。由于我的本地 .gitignore 仍然忽略这些文件,因此它认为我没有本地工作文件可以添加到索引中。我最终删除了所有文件,然后拉动起作用并将它们全部带入。
The root of the problem was that my colleague removed some entries from the .gitignore file in his branch that allowed several new files to come into his checkin. Since my local .gitignore was still ignoring those files, it didn't think I had local working files to add to the index. I ended up deleting all the files and then the pull worked and brought them all in.