GIT TIP – Push Only the Current Branch

Are you tired of always have to tell GIT which remote branch to push and not accidentally pushing all branches? You can actually tell GIT to only push the current branch to another branch with the same name:

git config –global push.default current

So now only the branch you have currently checked out will be pushed. If you omit the –global the change will only be in the current repository, if you don’t want the same behaviour in all repositories.

 
Other possible values are:
  • nothing – do not push anything. 
  • matching – push all matching branches. All branches having the same name in both ends are considered to be matching. This is the default. 
  • upstream – push the current branch to its upstream branch. 
  • tracking – deprecated synonym for upstream. 
  • current – push the current branch to a branch of the same name.

Matching is the default behaviour of GIT.