Git · Junior · Question 56 of 75

How do you set the upstream branch when pushing a new branch for the first time?

Explanation

-u (--set-upstream) links the local branch to origin/feature, so later a plain git push or git pull knows where to go.

Further reading

Problem with a question

Git · Junior · question 56

Test yourself

Take the Git · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz