Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

What does the -u argument mean in 'git push -u origin master'?

Web Master June 4, 2019

I new to Git and BitBucket, trying to learn how to use them from the online tutorials. I've been able to create my account and set up the repository. The Atlassian tutorial then tells me to issue the command 'git push -u origin master' to load the files I have on my local machine up to the BigBucket repository.

I understand all the arguments except the '-u' which I have not been able to find through any online searches. And while I don't distrust the tutorial, I really like to know what the commands mean when I use them.

1 answer

1 accepted

1 vote
Answer accepted
Edwin Kyalangalilwa
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 4, 2019
Web Master June 4, 2019

Thanks for your quick response!

So, how does 'git push -u origin master' differ in effect from simply 'git push origin master'?

Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 4, 2019

-u or --set-upstream adds tracking information in the config file so that you do not have to specify the remote when using git pull. 

Web Master June 4, 2019

Thank you again. I will add that to my growing fund of git-knowledge.

Like Edwin Kyalangalilwa likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events