Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6391381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:39:52+00:00 2026-05-25T03:39:52+00:00

Possible Duplicate: What exactly does the "u" do? "git push -u origin master" vs

  • 0

Possible Duplicate:
What exactly does the "u" do? "git push -u origin master" vs "git push origin master"

In Github, when you created an empty repository, the instructions ask you to execute

git push -u origin master

So my question is, what’s the use of -u option?

After reading the manpage I still didn’t get it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T03:39:52+00:00Added an answer on May 25, 2026 at 3:39 am

    git can set a particular branch in a remote repository to be the default “upstream” branch for that particular branch. For example, if you clone an existing repository, git will, by default, associate your master branch with the master branch in the origin repository, i.e. the one you’re cloning from. This means that git can provide helpful defaults, such as being able to just use git pull while on master rather than having to specify a repository and a branch to fetch and merge from. It’s also this association that lets git produce its helpful “Your branch is ahead of origin/master by 10 commits” messages…

    However, if you haven’t cloned from an exisiting repository, but you’re wanting to set up a new origin remote that represents your newly created GitHub repository, you have to manually tell git to associate your master with master in the new origin repository. The -u to git push means “as well as pushing, associate my master branch with the one I’m pushing to”. You only need to do this once for that association to be recorded in .git/config.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Reference - What does this symbol mean in PHP? What exactly does
Possible Duplicate: How does system() exactly work in linux? For the sake of my
Possible Duplicate: How exactly does <script defer=“defer”> work? Can anybody explain me how defer
Possible Duplicate: What does $(function() {} ); do? what exactly does the following syntax
Possible Duplicate: What exactly does database normalization do? Can someone please clarify data normalization?
Possible Duplicate: What does the term Plain Old Java Object(POJO) exactly mean? I know
Possible Duplicate: How does the Google Did you mean? Algorithm work? Suppose you have
Possible Duplicate: Learning about LINQ Hi everyone, I just want to understand what exactly
Possible Duplicate: JavaScript: formatting number with exactly two decimals How do I limit the
Possible Duplicate: When do we have to use copy constructors? Why exactly are C++

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.