warning: push.default is unset; its implicit value is changing in

注意:要提交本地数据到远程仓库,则必须确认远程仓库当前所指示的分支并不是本地分支直接对应的远程仓库(即直接git clone过来的),因为如果远程仓库所指示的分支可能处于编译的状态,所以不能指示当前分支,以防止冲突。



Git 2.0 更改 push default 为‘simple’

oschina  oschina  发布于2013年11月03日  收藏 44  评论 11

在腾讯云上创建您的SQL Cluster>>>»  

Git

如果你最近更新了 Git,你可能会在执行 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

‘matching’ 参数是 Git 1.x 的默认行为,其意是如果你执行 git push 但没有指定分支,它将 push 所有你本地的分支到远程仓库中对应匹配的分支。

Simple

而 Git 2.x 默认的是 simple,意味着执行 git push 没有指定分支时,只有当前分支会被 push 到你使用 git pull 获取的代码。

修改默认设置

从上述消息提示中的解释,我们可以修改全局配置,使之不会每次 push 的时候都进行提示。对于 matching 输入如下命令即可:

git config --global push.default matching

而对于 simple ,请输入:

git config --global push.default simple

via nicoschuele

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值