Preparing for Git 2.0

| posted in: nerdliness 


After a recent update to Git I started getting the following message when doing a git push.

warning: push.default is unset; its implicit value is changing in 
Git 2.0 from 'matching' to 'simple'. To squelch this message 
and maintain the current behavior after the default changes, use: 

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use: 

  git config --global push.default simple

The push.default setting controls what happens when you do a git push without specifying a branch. When push.default is set to matching all local branches are pushed to their matching remote pairs.

The new default, simple, means that when you do a git push without specifying a branch, only your current branch will be pushed to the one git pull would normally get your code from.

As the message explains you can configure this setting in your .gitconfig file by using one of the two lines below.

git config --global push.default matching

or

git config --global push.default simple

I’ve gone ahead and set my push.default to be simple.

Author's profile picture

Mark H. Nichols

I am a husband, cellist, code prole, nerd, technologist, and all around good guy living and working in fly-over country. You should follow me on Twitter.