错误:push.default is unset; its implicit 的解决

来源:互联网 发布:seo网站结构分析工具 编辑:程序博客网 时间:2024/05/25 12:20

完整错误日志:

warning: push.default is unset; its implicit value is changing inGit 2.0 from 'matching' to 'simple'. To squelch this messageand maintain the current behavior after the default changes, use:git config --global push.default matchingTo squelch this message and adopt the new behavior now, use:git config --global push.default simple

‘matching’ 参数是 Git 1.x 的默认行为,其意是如果你执行 git push 但没有指定分支,它将 push 所有你本地的分支到远程仓库中对应匹配的分支。而simple是 Git 2.x 默认的,意味着执行 git push 没有指定分支时,只有当前分支会被 push 到你使用 git pull 获取的代码。

根据提示,运行:git config –global push.default matching 或: git config –global push.default simple,以后再push就不会有警告了。

push.default matching和push.default simple的区别:

  • push.default设置maching的意思是:git push 会把你本地所有分支push到名称相对应的远程主机上。这意味着可能你会在不经意间push一些你原本没打算push的分支。
  • push.default设置成simple的意思是:git push仅仅把当前所在分支push到从当初git pull pull下来的那个对应分支上,另外,这个过程也会同时检查各个分支的名称是否相对应。
0 0
原创粉丝点击