git push warning: push.default is unset 分析解决
2016-02-21 23:24
525 查看
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获取的代码。
解决方案
1.修改git的全局配置,命令如下
git config --global push.default simple
2.警告是由于没有指定分支造成的,所以可以通过指定分支解决,命令如下
git push origin master #master 可换为其他想要指定的分支
相关文章推荐
- RPC failed; result=22, HTTP code = 411
- git更新已經刪除的文件
- 提取Git每次提交后Commit的文件
- GIT迁移服务器
- 分布式版本管理git入门指南使用资料汇总及文章推荐
- git终极指南:在实际开发中的应用
- Git远程操作详解
- 25个 Git 进阶技巧(翻译)
- 详解版本控制利器Git,SVN的异同以及适用范围
- Ruby实现的删除已经合并的git分支脚本分享
- 在 Shell 提示符中显示 Git 分支名称的方法
- Git使用基础篇(一些常用命令和原理)
- git fork同步是什么意思?
- Git使用小坑 Out of memory错误的解决方法
- Python的高级Git库 Gittle
- 使用GIT进行源码管理――GUI客户端小结
- 使用git代替FTP部署代码到服务器的例子
- linux系统安装git及git常用命令
- 分享下自己总结的Git常用命令
- Git 常用命令速查表(图文+表格)