开发者

Git Pull Aborting [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 11 years ago.

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 con开发者_开发技巧sole 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.


He probably put the commit somewhere in the existing commit tree, rather than on top of it.

Try this:

git fetch origin
git rebase origin/master

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 a not a fast-forward commit message. You don't want to do that, in the future.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜