the conflicts shouldn't even be conflicts... most of them are on the documentation I added, like tihs:
<<<<<<< HEAD
# returns the max_sequence for this section
=======
>>>>>>> merged with other_branch_that_isnt_master
the command I did was git pull --rebase origin master
but when I just do git pull origin master
, I still get tons of conflicts everywhere.
Why is it not merging appropriately? it's like git gave up on life.
How do I get git to actually merge my files?
I'm using git on Mac Lion.
It is likely that you committed to the wrong branch and had the branches diverge. This means that a rebase will no longer cleanly apply, creating conflicts.
One option is to perform a git merge
and do the hard manual work of fixing the conflicts. Once the branches have merged, you should only need to do the work once.
Another option is to ignore all of the changes in the other copy of master
and make your copy the authoritative one. This is not recommended, but it depends on your use case:
git fetch
git merge -s ours origin/master
Another option is to rewrite and fix the commit history as Dave has suggested. A summary follows:
gitk --all
or git log --graph --all
to visualise the history and see where the branches have diverged. git reset --hard
to rewind history to that commit git pull --rebase
git cherry-pick
your commits back onto the rebased history, hopefully minimising conflicts.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.