What is the git push -u command for? [duplicate]

1

I know that the push command sends the file to the virtual repository, but I do not know what PUSH -U does

    
asked by anonymous 24.07.2018 / 21:56

1 answer

1

Defines the default remote branch for the current local branch.

Any git pull future command (with the local branch checked-out) will try to bring commits from <remote-branch> current local branch.

One way to avoid having to explicitly --set-upstream is use the abbreviated flag -u , along with git push as follows

git push -u origin local-branch

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

Reference is here !

    
24.07.2018 / 22:33