git config push.default matching

June 4, 2009 Alex Chaffee

Upgraded to git 1.6.3 yet? You should, and Jason Rudolph says why (and if you’re on a Mac, Rob Sanheim says how.)

Sadly, after you do upgrade, when you start doing “git push”, your console will start to be littered with the following oddly patronizing message:

warning: You did not specify any refspecs to push, and the current remote
warning: has not configured any push refspecs. The default action in this
warning: case is to push all matching refspecs, that is, all branches
warning: that exist both locally and remotely will be updated.  This may
warning: not necessarily be what you want to happen.
warning: You can specify what action you want to take in this case, and
warning: avoid seeing this message again, by configuring 'push.default' to:
warning:   'nothing'  : Do not push anything
warning:   'matching' : Push all matching branches (default)
warning:   'tracking' : Push the current branch to whatever it is tracking
warning:   'current'  : Push the current branch

While I’m generally in favor of verbose warnings, this one is kind of bizarre. Essentially, it’s saying, “Warning! The command you just ran will continue to operate exactly as it did before!” Guys, telling us about new options is great but that’s what release notes are for.

Worse, they don’t provide keystroke-level instruction beyond the offhand gerund “configuring” on how to shush it. Here’s the result of my 8-minute speluking inside the output of “git help config”:

git config push.default matching

[Or, thanks to Alastair Brunton below

git config --global push.default matching


There, now, that wasn’t so hard after all, was it?

About the Author


Welcome Palm Pre and Palm webOS
Welcome Palm Pre and Palm webOS

Today's the big day: the Palm® Pre™ has launched. We've been happy to be partner with Palm and we've been ...

Press Reaction to the Palm Pre
Press Reaction to the Palm Pre

As we've been working on applications for the Palm Pre, lots of people have been asking us a lot of questio...

SpringOne 2021

Register Now