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
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:
git push origin $1:kballard-$1