EGit has a lovely feature where I can rename a local branch. For example, from master
to fix123
. The problem is that after the rename, EGit does not modify the corresponding Upstream Branch to refs/heads/fix123
. The consequence is that when I push the local branch to remote it by default goes to the original location (refs/heads/master
in this example).
The current behaviour is correct for Gerrit, which expects you to always push to the remote master
branch no matter what you name your branch locally.
However, this is annoying when working with GitHub, because GitHub typically expects you to submit to a branch other than master
so that you can then do a Pull Request (code review). So if you create your local branch based on origin/master
, and give it a new name fix123
, then when you attempt to push the branch to origin it will attempt to push directly onto the remote master
(which will either fail, or overwrite the master
branch without a code review--probably not what you wanted).
Is there a way to tell EGit, on a per-repository basis, to automatically rename the Upstream Branch when you rename the local branch?