What does the -u flag mean in git push -u origin master

I'm just wondering what the -u flag means in this git push -u origin master command?

thank

+45
git github
Sep 18 '13 at 8:55
source share
2 answers

The -u parameter performs the following actions: For each branch that has been updated or successfully pressed, add an up link (tracking), which is used without arguments git-pull and other commands.

So, after pushing your local branch with the -u option, this local branch will be automatically associated with the remote branch, and you can use git pull without any arguments.

+40
Sep 18 '13 at 9:13
source share

This is the same as --set-upstream

It was used to set the source as an output console in the git configuration.

This can help if you do not want to manually specify the remote each time you start git push.

Also...

Since you are new to /qaru.site / ... , do not rush to read What types of questions should I avoid? in Help , because sometimes you can find answers just by looking at the documentation .

+18
Sep 18 '13 at 8:58
source share



All Articles