Re: Using two-dot range notation in `git rebase`?

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

 



Hi Philip,

    git log upstream..HEAD

gives you all commits reachable from "HEAD", but not reachable from
"upstream". If you want to rebase this range and copy it onto newbase,
you'd run

    git rebase --onto newbase upstream

This will take the commits upstream..HEAD (the HEAD argument is
implicit), and you end up with

    newbase-.....-HEAD

containing all commits from (the previous) "HEAD" up to (but
excluding) "upstream". If "newbase" and "upstream" are identical, the
command can be simplified to `git rebase newbase`.

Maybe I'm misunderstanding the problem? Can you give an example of
`git rebase --onto newbase upstream branch` not working as expected?

Regards
Daniel

On Wed, Jul 28, 2021 at 5:38 PM Philip Oakley <philipoakley@iee.email> wrote:
>
> Is there a reasonable way to use the two-dot range notation in git
> rebase, particularly in an  --onto situation?
>
> In my case I have a short series that depends on both some existing Git
> for Windows (GfW) patches (`main` branch), and some patches now in
> `git/master`. I'm now able to rebase it onto the GfW `shears/master`
> branch which contains both sets of patches (and one that was in the last
> git release).
>
> It felt that it ought to be possible to use a simple two dot range to
> extract my series, rather than identifying the individual end points in
> a similar manner to that used in the description"set of commits .. shown
> by `git log <upstream>..HEAD`".
>
> Or is this something that could be a project?
> --
>
> Philip
>
>


-- 
typed with http://neo-layout.org



[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]

  Powered by Linux