Scenario:
svn commit
on the appropriate files therefore committing them to the branch #Assume the following is being done from inside a working copy of the trunk: svn merge -r 5:15 file:///path/to/repo/branches/my_foo
Hazzah! he's merged all his changes back into trunk! There's much rejoicing and drinking of Mountain Dew.
Now let's say another programmer comes along a week later and updates their working copy from revision 5 to revision 15. "Wow", they say. "I wonder what's changed since revision 5". The programmer then does an svn status
on their working copy and they get something like this:
------------------------------------------------------------------------ r15 | programmer1 | 2010-03-20 21:27:04 -0400 (Sat, 20 Mar 2010) | 1 line Merging Version 2.0 Changes into trunk ------------------------------------------------------------------------ r5 | programmer2 | 2010-02-15 10:59:55 -0500 (Mon, 15 Feb 2010) | 1 line Added assets/images/tumblr_icon.png to trunk
What the heck happened to all the notes that the other programmer put in with all of his commits in his branch? Do those not get pulled over during a merge? Am I crazy or just forgetting something?
So, instead of merging you first execute the following while on branch-b, git rebase master . This creates new commits that are copies of the old commits, i.e., the same change-set, author information and message, but new committer information and parent history.
When you perform a merge, you effectively merge one branch into another—typically a feature branch or bug fix branch into a main branch such as master or develop. Not only will the code changes get merged in, but also all the commits that went into the feature branch.
In a good workflow, the feature branch is deleted once its merged back into master. New branches should be created for each new feature(s) that you work on. If you're not super creative with coming up with branch names and/or want to reuse the same branch name, that is ok.
Merges a branch into the current branch, creating a merge commit. Use git checkout <target-branch> to switch to the branch into which you want to merge. Use git merge --no-ff -m <message> <source-branch> to merge a branch into the current branch, creating a merge commit with the specified <message> .
Try svn log -g
to include merge history that is stored since Subversion 1.5.
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