Hm, I have to read your question quite a few times before I got it.. It would help if you could illustrate the branches somehow, perhaps by pasting the git log --graph --oneline --all ascii tree<http://stackoverflow.com/questions/1064361/unable-to-show-a-git-tree-in-terminal> ?
So, you have three branches: B1, A1 and A2. I'll ignore the fact that the two latter ones are in a remote repo for now, as remote/local is irrelevant thus far. Then you go git rebase --onto A2 A1 B1 If I compare with the advanced example in http://learn.github.com/p/rebasing.html it would be git rebase --onto master server client As it is well described in the example, the above command plays the changes in branch 'client' onto the master branch, keeping out the chances that happened in branch server. This means that the changes in your branch B1 (since it branched out from A1) will be played on top of the history in A2. Only branch B1 is changed in your local repository. You accidentally typed: git rebase --onto A2 A1 A2 This means you will play the changes that have happend in A2 since branching from A1, on top of A2.. which doesn't make sense to me. I can't really judge from the result output of whether this messed something up or not. It's really hard to say without knowing more about the relationship between the branches here. As long as you haven't pushed the changes anywhere else, you can reset back with a reference to the reflog<http://stackoverflow.com/questions/134882/undoing-a-git-rebase> . Once you're back into the state you wish to be, try explaining here once again what you are trying to do. Maybe we can help if we understand more. On Friday, March 11, 2011 9:14:29 PM UTC+1, ryan wrote: > > I want to rebase the current branch B1 from origin/A1 to origin/A2 > so I want to use this command > git --onto origin/A2 origin/A1 B1 > > Q1: is this command right? (A2 is based on A1, current branch is B1, > B1 is already pushed to origin, a remote repo, and I think I will > force push B1 after rebase) > > but I accidentally typed > git --onto origin/A2 origin/A1 origin/A2 > and git says > ---- > First, rewinding head to replay your work on top of it... > Fast-forwarded origin/base to origin/base. > ---- > > Q2:I assume this command is safe and it didn't change anything right? > > THANKS IN ADVANCE > -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To post to this group, send email to git-users@googlegroups.com. To unsubscribe from this group, send email to git-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/git-users?hl=en.