Re: git push refspec to specify tracking branch

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

 



On Tue, Mar 30, 2010 at 10:24 PM, Kevin Ballard <kevin@xxxxxx> wrote:
> On Mar 30, 2010, at 6:19 PM, Avery Pennarun wrote:
>> git push origin localbranchname:remotebranchname
>
> Yes that works, but it's annoying to type out every time, especially when my
> branch has a long name and I don't want to risk typos. Even worse, the
> tab-completion in bash uses `git ls-remote` to complete the remote part of
> refspecs, so it's even slower to type "foo:kba<tab>" than it is to type
> "foo:kballard/foo".

You might consider creating a separate 'remote' entry then in your
.git/config.  You should be able to reconfigure the refspec on that
one to use a particular branch name instead of a wildcard.  It's not
exactly pretty, but laziness will be laziness.

A similar option would be to just make a shell alias and be done with it:

savebranch()
{
    git push origin $1:kballard-$1
}

Have fun,

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