Re: get-upstream

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

 



On Wed, Sep 22, 2010 at 11:37 PM, Jeff King <peff@xxxxxxxx> wrote:
> On Thu, Sep 23, 2010 at 02:16:43PM +1000, Ramana Kumar wrote:
>
>> Thanks Pat - that's awesome.
>> Is there a git shortcut for removing the refs/remotes or refs/heads
>> prefix? (I know I can just use other progs for that too)
>
> If you use the for-each-ref solution, you can use the :short modifier,
> like:
>
>  git for-each-ref --format='%(upstream:short)' `git symbolic-ref HEAD`
>
> -Peff
>

That's pretty cool.  Using the >=1.7.0 syntax you can also specify an
alternate branch like

$ git rev-parse --symbolic-full-name other-branch@{upstream}

Also, looking at TFM I discovered that @{u} is valid shorthand for
@{upstream} -- sweet.

Still, I think Peff's solution looks best and covers more versions of git.
--
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]