On Mar 11, 3:14 pm, ryan <ryansu...@gmail.com> 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
Based on the manual, it appears that you rebased the origin/A2 to have
the contents of branch origin/A1. This may have left some changes set
up. I would suggest checking what you have by using a git status and a
git diff just to make sure. If necessary, move your local changes to a
temp area and issue a fetch followed by a checkout of the branch that
you actually want. Then move your changes into the origin.
This seems to be what the original command that you wanted to do would
git rebase [-i | --interactive] [options] [--onto <newbase>]
<upstream> [<branch>] git rebase [-i | --interactive] [options] --onto
<newbase> --root [<branch>]
git rebase --continue | --skip | --abort
If <branch> is specified, git rebase will perform an automatic git
checkout <branch> before doing anything else. Otherwise it remains on
the current branch.
All changes made by commits in the current branch but that are not in
<upstream> are saved to a temporary area. This is the same set of
commits that would be shown by git log <upstream>..HEAD (or git log
HEAD, if --root is specified).
The current branch is reset to <upstream>, or <newbase> if the --onto
option was supplied. This has the exact same effect as git reset --
hard <upstream> (or <newbase>). ORIG_HEAD is set to point at the tip
of the branch before the reset.
The commits that were previously saved into the temporary area are
then reapplied to the current branch, one by one, in order. Note that
any commits in HEAD which introduce the same textual changes as a
commit in HEAD..<upstream> are omitted (i.e., a patch already accepted
upstream with a different commit message or timestamp will be skipped).
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 email@example.com.
To unsubscribe from this group, send email to
For more options, visit this group at