Create remote branches automatically

Have you ever created a branch on your computer and pushed it? Then you have probably been annoyed at the message:
fatal: The current branch test-branch has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin test-branch
But fear not! Help is near! Just add the following configuration option for git (the –global flag will put the option in your global git config, if you don’t want that, just remove the flag):
git config --global push.autoSetupRemote true
This entry was posted in Version control and tagged , by swk. Bookmark the permalink.

About swk

I am a software developr, data scientist, computational linguist, teacher of computer science and above all a huge fan of LaTeX. I use LaTeX for everything, including things you never wanted to do with LaTeX. My latest love is lilypond, aka LaTeX for music. I'll post at irregular intervals about cool stuff, stupid hacks and annoying settings I want to remember for the future.