Here is the printout of my actions with some comments:
esajine@ESAJINEWWW /c/git_repos $ mkdir test2; cd test2; git init; echo "initial" > 1.txt; git add .; git commit -m "initial commit"; git checkout -b next; echo "commit from next" > 2.txt; git add .; git commit -m "commit from next"; git checkout -b topic; echo "commit from topic" > 3.txt; git add .; git commit -m "commit from topic" Initialized empty Git repository in c:/git_repos/test2/.git/ warning: LF will be replaced by CRLF in 1.txt [master (root-commit) 89c5353] initial commit warning: LF will be replaced by CRLF in 1.txt 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 1.txt Switched to a new branch 'next' warning: LF will be replaced by CRLF in 1.txt warning: LF will be replaced by CRLF in 2.txt [next cec1eeb] commit from next warning: LF will be replaced by CRLF in 2.txt 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 2.txt Switched to a new branch 'topic' warning: LF will be replaced by CRLF in 1.txt warning: LF will be replaced by CRLF in 2.txt warning: LF will be replaced by CRLF in 3.txt [topic 9975772] commit from topic warning: LF will be replaced by CRLF in 3.txt 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 3.txt
esajine@ESAJINEWWW /c/git_repos/test2 (topic) $ pwd /c/git_repos/test2
esajine@ESAJINEWWW /c/git_repos/test2 (topic) $ git status # On branch topic nothing to commit (working directory clean)
esajine@ESAJINEWWW /c/git_repos/test2 (topic)
$ git log
commit 9975772c641c438a0a77932c18c159e9551706ce
Author: Eugene Sajine <esajine@foo.com>
Date: Fri Apr 9 13:04:24 2010 -0400
commit from topic
commit cec1eebc8db042b1b8a1002b07767eac56884126
Author: Eugene Sajine <esajine@foo.com>
Date: Fri Apr 9 13:04:24 2010 -0400
commit from next
commit 89c5353c9b0cfc476b323db11565ea210341469a
Author: Eugene Sajine <esajine@foo.com>
Date: Fri Apr 9 13:04:24 2010 -0400
initial commit
esajine@ESAJINEWWW /c/git_repos/test2 (topic) $ git rebase master Current branch topic is up to date. <======= Really? Topic is actually based on next – what does this "up to date" mean??
esajine@ESAJINEWWW /c/git_repos/test2 (topic)
$ git rebase --onto master topic
First, rewinding head to replay your work on top of it...
fatal: Not a range.
Nothing to do.
<======== topic..HEAD is not a range, agreed
esajine@ESAJINEWWW /c/git_repos/test2 (topic)
$ git rebase --onto master
fatal: Needed a single revision
invalid upstream
<========= fine
esajine@ESAJINEWWW /c/git_repos/test2 (topic)
$ git rebase --onto master next..topic
fatal: Needed a single revision
invalid upstream next..topic
<======== strange that this notation is not supported, considering
error above about the range
esajine@ESAJINEWWW /c/git_repos/test2 (topic) $ git rebase -i --onto master topic Successfully rebased and updated refs/heads/topic. <=== BUG – here it printed me “noop” in file to edit, when I exited it should do nothing, but it still did something and I double checked it.
esajine@ESAJINEWWW /c/git_repos/test2 (topic) $ git rebase --onto master topic Current branch topic is up to date.
esajine@ESAJINEWWW /c/git_repos/test2 (topic)
$ git log
commit 89c5353c9b0cfc476b323db11565ea210341469a
Author: Eugene Sajine <esajine@foo.com>
Date: Fri Apr 9 13:04:24 2010 -0400
initial commit
<====== topic now points to master, last commit from topic is
lost
esajine@ESAJINEWWW /c/git_repos $ git version git version 1.6.4.msysgit.0
Thanks, Eugene