Re: Question about git rebase --onto

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Wed, Feb 17, 2010 at 6:27 PM, Pascal Obry <pascal@xxxxxxxx> wrote:
>> Why do you add the last parameter ("HEAD")? If I run the rebase
>> without it, it works fine (ie. not on a detached HEAD).
>
> Right, without the final HEAD it is working. But it ought to work with
> it too. Hence my report.

In your original report though, you didn't say "HEAD"; you used a
branch. I quote:

On Wed, Feb 3, 2010 at 1:49 AM, Pascal Obry <pascal@xxxxxxxx> wrote:
>
> It seems to me that:
>
>   $ git co topic
>   $ git rebase --onto master topic~2 topic

I'm not trying to nit-pick, but it does matter - "git rebase --onto
foo baz~x baz" and "git rebase --onto foo HEAD~x HEAD" are quite
different.

According to the docs, the last parameter <branch> specifies the
branch to checkout to first before the rebasing takes place.
Therefore, I believe the behaviour you're experiencing when you
specify "HEAD" for the <branch> parameter is correct - git does a "git
checkout $(git rev-parse HEAD)", so you start the rebase on a detached
HEAD.

-- 
Cheers,
Ray Chuan
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]