Update February 2016:
git 2.8 (March 2016) removed that big warning message.
See commit 2f27520 (25 Feb 2016) by Matthieu Moy (moy
).
(Merged by Junio C Hamano -- gitster
-- in commit 15be621, 26 Feb 2016)
push
: remove "push.default is unset
" warning message
The warning was important before the 2.0 transition, and remained important for a while after, so that new users get push.default
explicitly in their configuration and do not experience inconsistent behavior if they ever used an older version of Git.
The warning has been there since version 1.8.0 (Oct 2012), hence we can
expect the vast majority of current Git users to have been exposed to
it, and most of them have already set push.default
explicitly. The
switch from 'matching' to 'simple' was planned for 2.0 (May 2014), but
actually happened only for 2.3 (Feb 2015).
Today, the warning is mostly seen by beginners, who have not set their
push.default
configuration (yet). For many of them, the warning is
confusing because it talks about concepts that they have not learned and
asks them a choice that they are not able to make yet. See for example "Warning: push.default is unset; its implicit value is changing in Git 2.0" (1260 votes for the question, 1824 for the answer as of writing)
Remove the warning completely to avoid disturbing beginners. People who
still occasionally use an older version of Git will be exposed to the
warning through this old version.
Eventually, versions of Git without the warning will be deployed enough
and tutorials will not need to advise setting push.default
anymore.
Original answer (March 2014)
That warning will soon change in git 2.0 (Q2 2014), with commit 289ca27 and commit 11037ee:
push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'.
To squelch this message and maintain the traditional behavior, use:
git config --global push.default matching
To squelch this message and adopt the new behavior now, use:
git config --global push.default simple
When push.default
is set to 'matching
', git will push local branches
to the remote branches that already exist with the same name.
Since Git 2.0, Git defaults to the more conservative 'simple
' "behavior, which only pushes the current branch to the corresponding remote branch that 'git pull
' uses to update the current branch.
See more at "Why is pushing to matching the default in Git?".