Reputation: 3165
So I am still newish with git and have just discovered the rebase
option to update a branch with master
.
I ran:
git checkout mybranch
git rebase master
Now I have a few merge conflicts. Is this the same as fixing normal merge conflicts? I want to accept masters
changes. I get something like
<<<<<<< 6tyuhjhgty54rtfghgftr
=======
<bunch of code here>
>>>>>>> Updates from Company
Which is which?
Upvotes: 0
Views: 341
Reputation: 21
in your master branch you need to use
git pull origin master
git checkout mybranch
git rebase -X ours master
Upvotes: 0
Reputation: 1380
When you call git rebase master
from your branch, the first thing git is going to do is checkout the master
branch.
This means that the changes made on master
are --ours
and the changes made on mybranch
are --theirs
.
Alwyn is correct in saying that from there, if you want to, you can call git checkout --theirs/--ours -- path/of/file
depending on whether you want the changes from mybranch
or master
.
Upvotes: 1
Reputation: 466
If you want to replace your changes with their changes as a whole for a file, then you can do a git checkout --theirs -- path-of-file
In your example above, the code above the ===='s is yours and the code below is the incoming code.
Upvotes: 1
Reputation: 3165
https://help.github.com/articles/resolving-merge-conflicts-after-a-git-rebase/
Basically It follows "standard procedures"
Upvotes: 0