+7 votes
1 view
in Devops and Agile by (28.1k points)
edited by

What does --set-upstream do?

I tried to understand it by reading the manual, but I didn't quite get it.

1 Answer

+6 votes
by (20k points)
edited by

For this, you could use:

git branch --set-upstream <remote-branch>

this command will set the default remote branch for the current branch. Git pull will bring the commits from <remote-branch> into the current local branch.

 Or you can use git push command with a -u option like this:

git push -u origin local-branch

This sets the upstream association for any future push/pull attempts automatically.

For more commands like this please go through the following tutorial that will help you understand the git

Welcome to Intellipaat Community. Get your technical queries answered by top developers !