I've been using Git for a while now and have recently downloaded an update only to find this warning message come up when I try to 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
I can obviously set it to one of the values mentioned, but what do they mean? What's the difference between simple
and matching
?
If I change it on one client will I need to do anything on other clients that I share repos with?
It's explained in great detail in the docs, but I'll try to summarize:
matching
means git push
will push all your local branches to the ones with the same name on the remote. This makes it easy to accidentally push a branch you didn't intend to.
simple
means git push
will push only the current branch to the one that git pull
would pull from, and also checks that their names match. This is a more intuitive behavior, which is why the default is getting changed to this.
This setting only affects the behavior of your local client, and can be overridden by explicitly specifying which branches you want to push on the command line. Other clients can have different settings, it only affects what happens when you don't specify which branches you want to push.