The difference between
git push origin <branch>
and
git push --set-upstream origin <branch>
is that they both push just fine to the remote repository, but it's when you pull that you notice the difference.
If you do:
git push origin <branch>
when pulling, you have to do:
git pull origin <branch>
But if you do:
git push --set-upstream origin <branch>
then, when pulling, you only have to do:
git pull
So adding in the --set-upstream
allows for not having to specify which branch that you want to pull from every single time that you do git pull
.