Is there any way to force merge branch A in branch B where all possible conflicts will be resolved in favor of branch B?
In any words how to push last branch B revision in branch A without vanity around conflicts?
First we run git checkout master to change the active branch back to the master branch. Then we run the command git merge new-branch to merge the new feature into the master branch.
To merge branches locally, use git checkout to switch to the branch you want to merge into. This branch is typically the main branch. Next, use git merge and specify the name of the other branch to bring into this branch. This example merges the jeff/feature1 branch into the main branch.
You can decide to take all of one branch over another by using hg merge --tool internal:other
or hg merge --tool internal:local
I'm not sure which way you want to merge but if you want to merge A into B taking all changes from B then you would do the following:
> hg update B
> hg merge A --tool internal:local
> hg commit -m "Merge"
The internal:local
merge tool will take the changes in the current revision (which is B because of the hg update B
) over the changes in the other revision, internal:other
would take all changes from A.
For more info use the following commands: hg help merge
and hg help merge-tools
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With