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.


Thanks for reading. Make sure you follow me on Twitter to stay up to date on the progress of my side projects T.LYWeather Extension, and Link Shortener Extension. If you are interested in the tech I use daily, check out my uses page.  

Leave a Reply

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