xcode
xcode

Reputation: 1717

What's the meaning of '-u' in 'git push -u origin master'?

I don't quite understand the meaning of -u in the git push -u origin master command. Can you explain what it's used for?

Upvotes: 1

Views: 740

Answers (1)

CJ Johnson
CJ Johnson

Reputation: 1101

The -u flag adds a reference to the upstream server you are pushing to. This lets you git pull without supplying additional arguments i.e. once you enter git push -u origin master you can then simply type git pull and this command will understand that in the future you mean git pull origin master.

Upvotes: 8

Related Questions