Skip to content

Instantly share code, notes, and snippets.

@padi
Created September 6, 2011 06:44
Show Gist options
  • Save padi/1196771 to your computer and use it in GitHub Desktop.
Save padi/1196771 to your computer and use it in GitHub Desktop.
How to lose your merge commit
marcrendlignacio:~/RebaseAfterMerge: development$ git log -p
commit 36b2f0ddba699197acfb4540bfe21113342e6c2a
Merge: 2e51d47 17e1525
Author: Padi Ignacio <marcrendlignacio@gmail.com>
Date: Tue Sep 6 14:18:46 2011 +0800
Merge branch 'feature-1' into development <<< watch this commit disappear.
commit 17e1525836ca186b7936a81dd6a4a6b6b2b0b0bc
Author: Padi Ignacio <marcrendlignacio@gmail.com>
Date: Tue Sep 6 14:05:56 2011 +0800
Added feature1
diff --git a/feature1 b/feature1
new file mode 100644
index 0000000..e69de29
commit 2e51d475cf9091cb1583e2d5a986a2d283ee0419
Author: Padi Ignacio <marcrendlignacio@gmail.com>
Date: Tue Sep 6 14:06:25 2011 +0800
Added change1
diff --git a/change1 b/change1
new file mode 100644
index 0000000..e69de29
commit 529bf836ca76a666b165a9f4aecd5498614ea3fd
Author: Padi Ignacio <marcrendlignacio@gmail.com>
Date: Tue Sep 6 13:54:22 2011 +0800
First commit
diff --git a/README b/README
####################################################################
# At this point someone else added a change with commit message: #
# Added a change from another computer #
# We'll try to rebase our own merge commit by using git pull #
####################################################################
marcrendlignacio:~/RebaseAfterMerge: development$ git pull --rebase <<< DO NOT USE git pull --rebase!
First, rewinding head to replay your work on top of it...
Applying: Added feature1
marcrendlignacio:~/RebaseAfterMerge: development$ git log
commit ac410781a8dcc47e5b085cf4b20a5380eb9a6c51
Author: Padi Ignacio <marcrendlignacio@gmail.com>
Date: Tue Sep 6 14:05:56 2011 +0800
Added feature1
commit 0833c13c8ab958f48465459219eed8aaf6c8b00d
Author: Padi <marcrendlignacio@gmail.com>
Date: Tue Sep 6 14:17:39 2011 +0800
Added a change from another computer
commit 2e51d475cf9091cb1583e2d5a986a2d283ee0419
Author: Padi Ignacio <marcrendlignacio@gmail.com>
Date: Tue Sep 6 14:06:25 2011 +0800
Added change1
commit 529bf836ca76a666b165a9f4aecd5498614ea3fd
Author: Padi Ignacio <marcrendlignacio@gmail.com>
Date: Tue Sep 6 13:54:22 2011 +0800
First commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment