we decide to share our work, we do push our changes to a remote repository.
you are working only in a single branch then you don't need to worry about this
topic. But if you have many branches, you must aware the default behavior of
'git push'. This command actually pushes all branches (not only your current
branch) to the corresponding remote branches.
mostly we want to push only the current branch to the remote repo. We can
configure GIT to change the default behavior.
config push.default upstream
means git will update only the current branch to it's upstream, when you do git
valid options are:
nothing : Do not push anything.
matching : Push all matching branches (default).
Push the current branch to its upstream branch. (the branch git pull would pull
tracking : Deprecated, use upstream instead.
current : Push the current branch to the remote
branch of the same name.
git version 1.7.11,
A new mode, "simple",
which is a cross between "current"
has been introduced. "git
push" without any refspec will push the current branch to the remote
branch with the same name, only when it is set to track the remote branch. This
mode is the new default value when push.default is not configured.