Changes between Version 13 and Version 14 of GitTips


Ignore:
Timestamp:
06/26/2011 02:43:45 PM (13 years ago)
Author:
johnnyg
Comment:

add how to merge a topic branch

Legend:

Unmodified
Added
Removed
Modified
  • GitTips

    v13 v14  
    101101}}} 
    102102 
     103== Delete the last commit == 
     104 
     105{{{ 
     106#!sh 
     107git reset --hard HEAD~1 
     108}}} 
     109 
    103110== Delete a remote branch == 
    104111 
     
    108115}}} 
    109116 
    110 == Delete the last commit == 
     117== Merge a topic branch == 
    111118 
     119In this example we assume that your topic branch, <topic>, is off master and that you are currently in your topic branch 
     120 
     121 1. Squash/reword/edit any commits if need be 
    112122{{{ 
    113123#!sh 
    114 git reset --hard HEAD~1 
     124git rebase -i master 
    115125}}} 
     126 1. Rebase your topic branch on top of current master 
     127{{{ 
     128#!sh 
     129git rebase master 
     130}}} 
     131 1. Change to master 
     132{{{ 
     133#!sh 
     134git checkout master 
     135}}} 
     136 1. ('''Fast-forward''') merge your topic branch into master 
     137{{{ 
     138#!sh 
     139git merge <topic> 
     140}}} 
     141 1. Delete your local topic branch (see above tip for remote deletion) 
     142{{{ 
     143#!sh 
     144git branch -d <topic> 
     145}}}