I have a central repo and a local repo. The repo has the "default" branch and one named branch "mybranch". If I am working in the named branch and want to occasionally merge my changes into default and then continue working in the named branch should I do this:
hg merge default
" to merge default INTO mybranchhg update default
" and "hg merge mybranch
" to merge mybranch INTO defaultdo same as above, but switch #2 with #4? (so that I am merging mybranch INTO default first?
Usually it does not matter if both branches are topic or feature branches. However, if you have an integration branch or a branch that marks what's been published, you definitely want to use the long lived integration branch as the one that's checked out and merge the other one into it.
If the developer wants to merge master into a branch that's protected, they must perform a GitLab merge request. If the developer wants to merge master into a branch that's unprotected, the easiest approach is to do a merge and push combination on the client machine.
Ideally, we would take all the changes in C*, apply them to master and resolve all conflicts. But because the branches have already been merged, git doesn't detect any changes and won't allow to merge again.
You write that you
want to occasionally merge my changes into default and then continue working in the named branch
You should normally not merge the feature branch into the default
branch, unless the feature is done. Maybe that is what you meant?
Just for reference, the recommended workflow is to do
Regularly (every couple of days) merge changes from default
into the feature branch:
hg pull
to get the latest changes from the other developershg merge
to integrate the latest changes into your feature branchWhen the feature branch is all done, you merge it back into default
:
hg pull
hg update default
to checkout the branch you want to merge intohg merge myfeature
to do the mergeThe final merge will be very small since the regular merges of default
into the feature branch makes sure that there is only a small distance from the two branch heads back to a common ancestor.
The way you have it now (merge default
into mybranch
first) is my preferred way.
I tend to use branches for isolating changes for a particular feature or refactoring, so it's best to bring changesets from default
into the named branch at regular intervals. This way the named branch's changes are kept up-to-date in relation to the default
branch.
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