vscode-git-graph icon indicating copy to clipboard operation
vscode-git-graph copied to clipboard

Push local branch to a remote branch with a different name

Open destag opened this issue 4 years ago • 3 comments

Describe the improvement that you'd like I would like to be able to push commits to remote branch with different name than local branch.

For example using git cli:

git push origin local-fix:remote-fix

Which creates remote branch named remote-fix

Additional context (optional) This would be very helpful when working with gerrit, where usually you don't push changes to the branch but to code review using refs/for namespace.

For example:

git push origin HEAD:refs/for/master

destag avatar Jul 13 '21 17:07 destag

Hi @destag,

Thanks for raising this improvement request, it would definitely be a nice capability to have in Git Graph!

mhutchie avatar Jul 13 '21 22:07 mhutchie

+1 for this, some organizations won't allow users to push to "root" branch names (e.g. foo), but require users to create them in user, specific trees, such as:

git push origin --set-upstream foo:user/brad/foo

However, it is nice to work locally with shorter branch names.

I think this could be accomplished with an option text box next to Set-Upstream in the Push dialog.

image

bradlitterell avatar May 15 '23 17:05 bradlitterell