From: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
To: Ryan Sun <ryansun81@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: rebase question
Date: Sat, 12 Mar 2011 20:05:32 -0500 (EST) [thread overview]
Message-ID: <alpine.DEB.2.00.1103121714280.15442@debian> (raw)
In-Reply-To: <AANLkTi=8Q+gNSY2jzgMMtPX-JHUy4MUEGNTeK85Ddvys@mail.gmail.com>
On Fri, 11 Mar 2011, Ryan Sun 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)
Yes, it is correct (except that the "rebase" is missing, of
course). Since A2 is based on A1, you could even use "git rebase
origin/A2 B1".
> 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.
> ----
I assume "origin/base" is what you called "origin/A2" above. The
output is a bit confusing in this case.
I tried "git rebase [--onto origin/pu] origin/pu origin/master". That
printed
Fast-forwarded origin/master to origin/pu.
which is even incorrect. It didn't (and shouldn't) update
origin/master, so it obviously shouldn't say that it did
either. Should be easy enough to fix. I will have a look at that when
I get some time.
> Q2:I assume this command is safe and it didn't change anything right?
It detached your HEAD at origin/A2, but no commits, nor refs would
have been changed or lost. You can safely checkout out B1 again if you
want.
/Martin
next prev parent reply other threads:[~2011-03-13 1:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-11 19:57 rebase question Ryan Sun
2011-03-13 1:05 ` Martin von Zweigbergk [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-05-12 0:06 Rebase Question Andrew Ottaviano
2021-05-12 0:23 ` Jacob Keller
2021-05-12 0:29 ` Bryan Turner
2021-05-12 0:44 ` Jeff King
2021-05-12 6:22 ` Junio C Hamano
2021-05-12 7:23 ` Felipe Contreras
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.00.1103121714280.15442@debian \
--to=martin.von.zweigbergk@gmail.com \
--cc=git@vger.kernel.org \
--cc=ryansun81@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox