Merging two branches with each other

When performing a regular merge, you always merge one branch into another. A branch that is merged with changes, while a branch that merges, does not change.

Now that I have a long-term branch of the function, I sometimes want to combine the function in master, but at the same time get all the changes that occurred in the wizard, meanwhile, and into the function.

I could do two separate mergers, but that seems messy. Is there a standard way to achieve what I want? Maybe just the presence of a function branch indicates a merge commit, changing what this branch indicates? I would like to know for both git and mercurial

+4
source share
2 answers

You may consider reinstalling the branch of your function against the wizard. Something like below:

git fetch origin master git rebase origin/master 

What happens is that your branch of your function is overwritten based on the last wizard, not the wizard from which you started it.

+1
source

After the function branch is merged into master, there is no point in continuing it, because all the commits from both the leading and the function branches are in the main. Just run another function branch from a merge commit.

The only case where a function branch continues after merging with the master (from the last commit to merging) is when you do not want changes from the master.

+1
source

All Articles