Back

Explore Courses Blog Tutorials Interview Questions
+6 votes
3 views
in DevOps and Agile by (29.3k 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

+5 votes
by (19.4k 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

 

Browse Categories

...