Search This Blog

Sunday, June 24, 2012

Git combine (merge) local commits into one

This tutorial is for those of you who used ToirtoiseGit which has the option of combining local commits before pushing them to the remote source and want to use that option in other Git clients.

To combine (merge) local commits into one before pushing them:

1. Switch to your local branch where your commits reside (actually it does NOT have to be a different branch, you can combine git commits on your local master as well)

2. I suppose you have already made 3 commits which you want to combine (merge) into one.

3. Reset (soft) as many commits down as you want to combine in your branch. When you execute a soft reset on a branch you end up having the combined result of the commits in your index ready to commit.

4. Commit the changes from your index - you end up having a single commit which a combined (merged) result of the previous three.



Screenshots were done using "SmartGit" from syntevo.

5 comments:

  1. thanks for share.

    ReplyDelete
  2. Thanks, exactly what I needed to know. So simple too!

    ReplyDelete
  3. ray ban sunglasses clarance outlet You fight cheap ray ban sunglasses clearance so hard, afraid of this fragile scrawny guy. cheap already cheap look into saving millions ray ban sunglasses clarance outlet of ray ban sunglasses clarance outlet people from untold miseries outer wear Superman underwear, cheap touch forehead, my God. ray ban sunglasses clarance outlet cheap punch and cheap ray bans clearance outlet then suddenly hit a cheap grabbed the man's wrist. cheap stunned, this girl really dare ah.

    ReplyDelete
  4. My colleagues were looking for 2014 CA FTB 3500 earlier this week and encountered a document management site with lots of form templates . If you need 2014 CA FTB 3500 too , here's http://pdf.ac/9Qn240

    ReplyDelete
  5. Savvy blog post , Just to add my thoughts , if others is requiring to merge two PDF files , my colleague found a tool here AltoMerge and also here http://pdf.ac/5GEHkM

    ReplyDelete

If you like this post, please leave a comment :)