Set Git Default Upstream Branch

When creating branches in git, have you noticed that you always have to set the upstream before you can push?

fatal: The current branch test has no upstream branch.
To push the current branch and set the remote as upstream, use

Fortunately, a simple git config setting will make your life easier and save you some keystrokes. Just run the command below.

git config --global push.default current

Now you should ever have to set the upstream manually.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.