We want a bug fix that went into trunk:
$ cd sayings $ gitk --all
Find the commit we want:
$ git checkout master $ git log ... commit 80e837528448ac65196fe6096477ae148907cb7b Author: Andy Balaam >andybalaam at artificialworlds.net> Date: Fri Jul 5 09:49:10 2013 +0100 Fix missing name in surprise expression ...
Cherry-pick it:
$ git checkout release-0.2 Switched to branch 'release-0.2' $ git cherry-pick 80e837528448ac65196fe6096477ae148907cb7b [release-0.2 74acfc9] Fix missing name in surprise expression 1 file changed, 1 insertion(+), 1 deletion(-)
What happened?
$ git checkout master $ git log ... commit 74acfc9de12891ef4b390cc82dd4a50cdc7c6cce Author: Andy BalaamDate: Fri Jul 5 09:49:10 2013 +0100 Fix missing name in surprise expression
It's a new, different commit
Tell it to merge:
$ git branch * master release-0.1 release-0.2 $ git merge release-0.2 Auto-merging southern.txt CONFLICT (content): Merge conflict in southern.txt Automatic merge failed; fix conflicts and then commit the result.
Where are we?
$ git status # On branch master # Unmerged paths: # (use "git add/rm..." as appropriate to mark resolution) # # both modified: southern.txt # no changes added to commit (use "git add" and/or "git commit -a")
To complete merging, we must:
Important: don't do anything else until we're done!
Gor blimey Charlie Oi oi Awight lads <<<<<<< HEAD Where to guvnor? Me old China Apples and pears ======= 'Ow's it goin'? Where to guv'nr? Me ol' China >>>>>>> release-0.2
$ git mergetool merge tool candidates: opendiff kdiff3 tkdiff xxdiff meld tortoisemerge gvimdiff diffuse ecmerge p4merge araxis bc3 vimdiff emerge Merging: southern.txt Normal merge conflict for 'southern.txt': {local}: modified file {remote}: modified file Hit return to start merge resolution tool (kdiff3):
$ # mergetool did the "add" for us $ git commit ...
$ gitk --all
Alternatively, abort a merge:
$ git merge --abort
$ git checkout master $ git rebase release-0.2First, rewinding head to replay your work on top of it... Applying: Northern expression of affectionate surprise Applying: Scottish sayings file. Applying: Stating the obvious for Scots Applying: Fix missing name in surprise expression Using index info to reconstruct a base tree... Falling back to patching base and 3-way merge... No changes -- Patch already applied. Applying: Add a contemptuous scots saying Applying: Fruit-based reference to stairs Using index info to reconstruct a base tree... Falling back to patching base and 3-way merge... Auto-merging southern.txt CONFLICT (content): Merge conflict in southern.txt Failed to merge in the changes. Patch failed at 0006 Fruit-based reference to stairs When you have resolved this problem run "git rebase --continue". If you would prefer to skip this patch, instead run "git rebase --skip". To check out the original branch and stop rebasing run "git rebase --abort".
You can abort:
$ git rebase --abort
$ git mergetool ... $ git rebase --continue ... $ git mergetool ... $ git rebase --continue
$ gitk --all
The difference:
Videos | youtube.com/user/ajbalaam |
---|---|
@andybalaam | |
Blog | artificialworlds.net/blog |
Projects | artificialworlds.net |