-2

While trying to push my code on GitHub facing this error on the terminal:

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

    git push --set-upstream origin master

To have this happen automatically for branches without a tracking
upstream, see 'push.autoSetupRemote' in 'git help config'.  

Kindly assist to overcome it. Also, kindly let me know the exact reason behind this error message. Your help is much appreciated.

As per the solution: git push --set-upstream origin master

I will try the above command. But, I fear that after using it, my earlier code in that repository will be cleared and this new code will take place of that. Kindly rectify me, in case I'm wrong.

knittl
  • 246,190
  • 53
  • 318
  • 364

0 Answers0