I've been wondering if there's an easy way to push and pull a local branch with a remote branch with a different name without always specifying both names.
$ git clone myrepo.git
$ git checkout -b newb
$ git commit -m "Some change"
$ git push origin newb:remote_branch_name
$ git pull
$ git push
% git push origin newb:remote_branch_name
Sure. Just set your
upstream to push branches to their upstreams (which is the same that
pull will pull from, defined by
branch.newb.merge), rather than pushing branches to ones matching in name (which is the default setting for
git config push.default upstream
Note that this used to be called
upstream before Git 188.8.131.52, so if you're using an older version of Git, use
tracking instead. The
push.default option was added in Git 1.6.4, so if you're on an older version than that, you won't have this option at all and will need to explicitly specify the branch to push to.