Last Updated: May 01, 2016
·
207
· mdeiters

One liner to git push and create a new remote branch

Sometimes I want to push local changes on master to a new branch on origin. If you don't want to create a local branch then this one-liner will help:

git push origin HEAD:refs/heads/new-branch-name

This will create a new branch on origin named new-branch-name