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

  • SEARCH
  • Home
  • 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 8954501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:19:49+00:00 2026-06-15T14:19:49+00:00

I have read the git man about push command, but I still don’t understand

  • 0

I have read the git man about push command, but I still don’t understand the EXACT difference between current and upstream to be set in the push.default

I want that our team will just do push, and only changes on the branch that they are currently working on, will be pushed.
As I understand, this branch is the one that marked with * (star) when I do git branch.

Thanks for helping out.

  • 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-06-15T14:19:50+00:00Added an answer on June 15, 2026 at 2:19 pm

    The question is what are you pushing, and to where:

    • current:

      • “what” is only your current branch (no other branches),
      • “to where” is a branch of the same name (created if it doesn’t exist) in the upstream repo.
    • upstream:

      • “what” is also only the current branch,
      • “to where” is to whatever branch (not necessarily of the same name) on the upstream repo has been assigned as an upstream branch for the local branch you are pushing.

    As explained here, Git2.0 will additionally introduce a new default for push.default: simple

    simple is like upstream, but the upstream has to have the same name as well or the push will fail.


    Pushing only one branch (with the mode “simple“, “current” or “upstream“) avoids the scenario where all matching branches are pushed (mode “matching“, which was the default for a long time), even though some of your branches might not be ready to be pushed.

    (master)> git push
    ...
    To git@github.com:jkubicek/my_proj.git
       21b430d..dd378ca  master -> master
     ! [rejected]        release -> release (non-fast-forward)
    error: failed to push some refs to 'git@github.com:jkubicek/my_proj.git'
    hint: Updates were rejected because a pushed branch tip is behind its remote
    hint: counterpart. 
    hint: If you did not intend to push that branch, you may want to
    hint: specify branches to push or set the 'push.default' configuration
    hint: variable to 'current' or 'upstream' to push only the current branch.
    

    The difference between the two (current and upstream) is in the pull (what to pull from the remote to your branch?):

    • pushing “current” doesn’t mean that your current branch B has remote/B has its upstream branch.
      Ie: branch.B.merge isn’t set, when your are pushing the “current” branch.
      Ie: when pulling to B, git won’t know what branch to pull.

    • pushing “upstream” means that your current branch B has remote/B has its upstream branch.
      Ie: branch.B.merge is set, when your are pushing the “upstream” branch.
      Ie: when pulling to B, git knows what branch to pull (as well as which remote repo: branch.B.remote)

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

Sidebar

Related Questions

I have read few articles about table partioning but still I am bit confused
I have read this thread when I got the the git: command not found
I've read this book section about git branches. I have create a branch called
I have a few questions about git. I have read a couple of documents
I want to have git repos accessable in redmine. But what about auto update
I have read about implementing git hooks to minify css and js source files
I have read about multiple different git branching strategies and I was suprized that
I have read many answers to questions about dynamically resizing NSWindows and nothing has
I have read some of the questions and answers here, but it none match
I have read a bunch of forums on this but none have solved my

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.