git push to the Current Branch

Quite often when you are working in a branch in Git, you want to push the committed stuff to the server side. You’d do the following.

git push origin my_long_branch_name_that_has_description_of_this_branch

You can set a global option for “git push” to push the code to the current branch by executing the following command.

git config --global push.default current

Now you can just type…

git push

This saves me so many keyboard typing and copy and paste of the current branch names.

Author: admin

A software engineer in greater Seattle area

Leave a Reply

Your email address will not be published. Required fields are marked *