![Cadet Cadet](/html/@4FA5936C845A59DAAAABD9F7250A363E/rank_icons/RH_SERV_005534_01_MECH_Rank_Cadet_16x16@2x.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 9,618 Views
What does --set-upstream doess
![Community Manager Community Manager](/i/rank_icons/admin.gif)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 9,593 Views
Hello @cvrr !
Yes that would make a difference !
--set-upstream tells Git to set the upstream branch for the current local branch. The upstream branch is the branch on the remote repository that you want to keep your local branch synchronized with.
If you use the same without --set-upstream --> It will still push it to the remote repo but it wont set the upstream for testbranch.
So the difference you will see during pulling,
if you don't use --set-upstream , 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
![Cadet Cadet](/html/@4FA5936C845A59DAAAABD9F7250A363E/rank_icons/RH_SERV_005534_01_MECH_Rank_Cadet_16x16@2x.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 9,501 Views
The --set-upstream option in git push links your local branch to the corresponding remote branch. This means that, in the future, you can just use git pull or git push without specifying the branch. If you remove --set-upstream, the push will work for that instance, but the upstream link won't be set, so you'll need to specify the remote branch in subsequent pulls or pushes for that local branch.
Ben jonson