warning: push.default is unset的解決方案
在執行 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
經百度後,得知‘matching’ 參數是 Git 1.x 的默認行為,其意是如果你執行 git push 但沒有指定分支,它將 push 所有你本地的分支到遠程倉庫中對應匹配的分支。而 Git 2.x 默認的是 simple,意味著執行 git push 沒有指定分支時,隻有當前分支會被 push 到你使用 git pull 獲取的代碼。
根據提示,修改git push的行為:
git config --global push.default matching
再次執行git push 得到解決。
最後更新:2017-04-03 12:55:07