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.


  1. thanks for share.

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

  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.

  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

  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

  6. Clever idea. Am relatively new to Git and am familiar with the usual way to do this (via interactive rebasing, squashing unwanted commits), but never gave your idea any thought (though I'm comfortable with reset). Much easier than the rebase route (hopefully no downside but will think about it). Thanks!


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