当我执行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
See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)
我需要做什么?
答案 0 :(得分:4)
您没有收到错误,而是警告。 Git本身建议你可以做什么。我建议使用该配置:
git config --global push.default simple
因为这不那么令人困惑。使用该配置,没有refspecs的git push
将仅推送一个引用:它将将当前分支推送到其上游分支,但是但是如果上游分支的名称是则拒绝推送不同于本地的(我引用the manual page of git-config itself)。