tags:

views:

1185

answers:

3

Here's an example:

>git status
# On branch master
nothing to commit (working directory clean)
>git checkout -b test-branch
>vi test.c
>git add test.c
>git commit -m "modified test.c"
>vi README
>git add README
>git commit -m "modified README"

Now I want to do a 'git rebase -i' that will let me rebase all commits for this branch. Is there something like 'git rebase -i HEAD~MASTER' or similar. I figure I could do 'git rebase -i HEAD~2', but I really don't want to have to count how many commits have been made. I could also do 'git rebase -i sha1' but I don't want to comb through git log to find the first commit sha1. Any ideas?

A: 

Why not just do git -rebase -i HEAD~[A number you know is higher than the number of commits]? Just "pick" the commits you want to leave unchanged.

ehamberg
This doesn't work, because git will try to find that commit and fail
Paul Betts
+5  A: 

Have you tried: git rebase -i master?

ididak
I just tested this in my sample repository and it works.
Otto
+4  A: 
Otto