From f160a96ef6b5223ead42fe43040ca41d4a85a1c2 Mon Sep 17 00:00:00 2001 From: Joe Block Date: Wed, 30 Jul 2014 14:57:27 -0700 Subject: [PATCH] Add entry for safe rebasing of unpushed commits --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index c745e82..0b4e237 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,18 @@ If everything is successful, you should see something like this: (master)$ Successfully rebased and updated refs/heads/master. ``` + +#### I want to combine only unpushed commits + +Sometimes you have several work in progress commits that you want to combine before you push them upstream. You don't want to accidentally combine any commits that have already been pushed upstream because someone else may have already made commits that reference them. + +``` +(master)$ git rebase -i @{u} +``` + +This will do an interactive rebase that lists only the commits that you haven't already pushed, so it will be safe to reorder/fix/squash anything in the list. + + ### Possible issues with interactive rebases