Skip to content

Instantly share code, notes, and snippets.

@dmalikov
Last active December 15, 2015 02:59
Show Gist options
  • Save dmalikov/5190676 to your computer and use it in GitHub Desktop.
Save dmalikov/5190676 to your computer and use it in GitHub Desktop.
!

How to make merge commit with same parent commits

git cat-file commit master | awk '/^parent.*/{print $0}; //{print $0}' | git hash-object --stdin -w -t commit | xargs git checkout -B master

Here it is:

$> git show --stat
commit 52eb56f6d5816f9e43015878e60a41cbbfb3e702
Merge: 62570ee 62570ee
Author: Dmitry Malikov <[email protected]>
Date:   Sun Mar 17 07:56:40 2013 +0400

    Bye-bye, davmail

 xinitrc | 3 ---
 1 file changed, 3 deletions(-)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment