In order to control the default behavior, try setting push.default in your git config.
This will define the action git push should take, if
A. No refspec is given on the command line,
B. No refspec is configured in the remote, and
C. No refspec is implied by any of the options given on the command line.
Let us talk about the possible values:
nothing: Do not push anything
matching: Push all matching branches
Note that, branches with the same name in both ends are considered to be matching. .
upstream: This pushed the current branch to its upstream branch
current: This pushs the current branch to a branch of the same name
simple: Just 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.
These 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.
Here are two command line examples:
In order to have a look at the current configuration use the following:
$ git config --global push.default
In order to set a new configuration use the following command:
$ git config --global push.default current