Git Alias To Make Pushing Branches Easy

If you want to push the current branch to the remote origin then you need to type in the following command.

git push -u origin HEAD 

To simplify this, edit your local ~/.gitconfig file and add the following lines (don't add another [alias] if you already have one).

[alias]
        mr = push -u origin HEAD

With this in place you can push your currently checked out branch to the origin using the command.

git mr

Add new comment

The content of this field is kept private and will not be shown publicly.