Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git Pull Aborting [closed]

Tags:

git

git-pull

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.

like image 464
sisdog Avatar asked Aug 12 '11 00:08

sisdog


1 Answers

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.

like image 140
Stefan Kendall Avatar answered Oct 14 '22 02:10

Stefan Kendall