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 222757

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:09:25+00:00 2026-05-11T19:09:25+00:00

I use the following command to push to my remote branch: git push origin

  • 0

I use the following command to push to my remote branch:

git push origin sandbox

If I say

git push origin

does that push changes in my other branches too, or does it only update my current branch? I have three branches: master, production and sandbox.

The git push documentation is not very clear about this, so I’d like to clarify this for good.

Which branches and remotes do the following git push commands update exactly?

git push 
git push origin

origin above is a remote.

I understand that git push [remote] [branch] will push only that branch to the remote.

  • 0 0 Answers
  • 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-11T19:09:26+00:00Added an answer on May 11, 2026 at 7:09 pm

    You can control the default behavior by setting push.default in your git config. From the git-config(1) documentation:

    push.default
    

    Defines the action git push should take if no refspec is given on the command line, no refspec is configured in the remote, and no refspec is implied by any of the options given on the command line. Possible values are:

    • nothing: do not push anything

    • matching: (default before Git 2.0) push all matching branches

      All branches having the same name in both ends are considered to be matching.

    • upstream: push the current branch to its upstream branch (tracking is a deprecated synonym for upstream)

    • current: push the current branch to a branch of the same name

    • simple: (new in Git 1.7.11, default since Git 2.0) like upstream, but refuses to push if the upstream branch’s name is different from the local one

      This is the safest option and is well-suited for beginners.

    The simple, current and upstream modes are for those who want to push out a single branch after finishing work, even when the other branches are not yet ready to be pushed out

    Command line examples:

    To view the current configuration:

    git config push.default
    

    To set a new configuration:

    git config push.default current
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 115k
  • Answers 115k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Maybe this can help you: get some stack trace info… May 11, 2026 at 10:23 pm
  • Editorial Team
    Editorial Team added an answer header("Cache-Control: no-cache, must-revalidate"); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");… May 11, 2026 at 10:23 pm
  • Editorial Team
    Editorial Team added an answer If I understand (and assume) correctly: You are inserting content… May 11, 2026 at 10:23 pm

Related Questions

I'm a Git newbie. I recently moved a Rails project from Subversion to Git.
I've got a contract to write part of a program. The person writing the
I use the following command to output the schema for a MySQL db: mysqldump
I use Visual C++ 2008 in Visual Studio 2008. I frequently use the following
I have a shim library (shared, C++) which calls functions in another shared library

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.