git 同步代码

来源:互联网 发布:网络监控机安装图解 编辑:程序博客网 时间:2024/06/04 18:41

自己同步本地数据的时候。在执行 git push 时看到如下消息:

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 所有你本地的分支到远程仓库中对应匹配的分支。而 Git 2.x 默认的是 simple,意味着执行 git push 没有指定分支时,只有当前分支会被 push 到你使用 git pull 获取的代码。

根据提示,修改git push的行为:

git config --global push.default matching

再次执行 git push 得到解决。
0 0