git push refspec to specify tracking branch

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

git push refspec to specify tracking branch

From: Kevin Ballard <hidden>
Date: 2016-06-15 22:48:31

Is there any way in a refspec to specify the tracking branch corresponding to a local branch? Specifically, I want to be able to write some variant of `git push origin +foo` and have it push foo to its tracking branch. I can't find any way to do that according to the current documentation.

-Kevin Ballard

Re: git push refspec to specify tracking branch

From: Avery Pennarun <hidden>
Date: 2016-06-15 22:48:31

On Tue, Mar 30, 2010 at 9:06 PM, Kevin Ballard [off-list ref] wrote:
Is there any way in a refspec to specify the tracking branch
corresponding to a local branch? Specifically, I want to be able to
write some variant of `git push origin +foo` and have it push foo to
its tracking branch. I can't find any way to do that according to
the current documentation.
This is probably a stupid suggestion, but since you're only likely to
have a single local branch corresponding to a particular remote
branch, the easiest answer is to rename your local branch to have the
same name :)

Otherwise, what you probably want is:

   git push origin localbranchname:remotebranchname

You can also delete a remote branch:

   git push origin :remotebranchname

Have fun,

Avery
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help