近期更新了git,项目push时会提示这样的信息:

warning: push.default 尚未设置,它的默认值在 Git 2.0 已从 'matching'
变更为 'simple'。若要不再显示本信息并保持传统习惯,进行如下设置: git config --global push.default matching 若要不再显示本信息并从现在开始采用新的使用习惯,设置: git config --global push.default simple 当 push.default 设置为 'matching' 后,git 将推送和远程同名的所有
本地分支。 从 Git 2.0 开始,Git 默认采用更为保守的 'simple' 模式,只推送当前
分支到远程关联的同名分支,即 'git push' 推送当前分支。 参见 'git help config' 并查找 'push.default' 以获取更多信息。
('simple' 模式由 Git 1.7.11 版本引入。如果您有时要使用老版本的 Git,
为保持兼容,请用 'current' 代替 '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

原文地址请查看

Git 2.0 更改 push default的更多相关文章

  1. warning: push.default is unset; its implicit value is changing in Git 2.0 from 'matching' to 'simple'.

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

  2. git push.default is unset

    warning: push.default is unset; its implicit value is changing inGit 2.0 from 'matching' to 'simple' ...

  3. git push default

    今天使用git push的时候出现了如下提示: warning: push.default is unset; its implicit value is changing in Git 2.0 fr ...

  4. Git 2.x 中git push时遇到 push.default 警告的解决方法

    近在学习使用 git&GitHub,然后今天遇到了一个问题.在执行 git add 和 git commit 操作之后,再进行 git push 操作,出现了如下提示: $ git push ...

  5. git push.default设置

    转自:http://blog.csdn.net/daijingxin/article/details/51326715 在进行一次空仓库的提交时,我遇到了这个警告 警告如下: warning: pus ...

  6. Git warning push.default is unset

    warning: push.default is unset; its implicit value is changing in Git 2.0 from 'matching' to 'simple ...

  7. [git]解决:git config --global push.default matching

    解决:git config --global push.default matching 这个警告的意思是:需要设置默认push的分支,所以设置好全局push的默认分支就好了.命令如下: 在有git目 ...

  8. git init error:Malformed value for push.default: simple

    git init error:Malformed value for push.default: simple 1.git config --global push.default matching

  9. warning: push.default is unset;

    git push warning questions This warning was introduced in Git 1.7.11 along with the simple style of ...

随机推荐

  1. python中的slice用法

    同事在网上做题碰到的 >>> items = [0,1,2,3,4,5,6,7,8,9] >>> a = _____(2,4) >>> items ...

  2. 【机器学习学习】SKlearn + XGBoost 预测 Titanic 乘客幸存

    Titanic 数据集是从 kaggle下载的,下载地址:https://www.kaggle.com/c/titanic/data 数据一共又3个文件,分别是:train.csv,test.csv, ...

  3. JS——判断一个对象是否为空

    判断一个对象是否为空对象,本文给出三种判断方法: 1.最常见的思路,for...in...遍历属性,为真则为"非空数组":否则为"空数组" 2.通过JSON自带 ...

  4. JavaScript八张思维导图—字符串用法

    JS基本概念 JS操作符 JS基本语句 JS数组用法 Date用法 JS字符串用法 JS编程风格 JS编程实践 不知不觉做前端已经五年多了,无论是从最初的jQuery还是现在火热的Angular,Vu ...

  5. 在Intellij idea 2017中运行tomcat 8.5

    前提:jdk,tomcat都已安装完,环境变量该配置的都配置了,tomcat  localhost:xx  能登上去 首先新建web小项目 new  project next 为项目命个名 finis ...

  6. iptabes的用法

    iptables的用法 基本用法: iptables [-t table] [subcommand] chain [rulenum] [options...] [match] [target] ipt ...

  7. Centos 6.9安装配置MongoDB

    注意:centos6上就不要装mongo3了,容易出错. 1. 下载 curl -O http://downloads.mongodb.org/linux/mongodb-linux-x86_64-2 ...

  8. 在eclipse中创建maven webapp项目时弹出错误-解决办法

    在eclipse中创建maven webapp项目时报错: Could not resolve archetype org.apache.maven.archetypes:maven-archetyp ...

  9. ArcGIS字段计算器分割字段中的字符串

    ArcGIS字段计算器分割字段中的字符串 实例:在一个字段中存有长宽高三个属性数据,以x分割.例如sss为字段名(字段属性为文本类型),数据格式为:100x200x300,利用字段计算器分别将三个数存 ...

  10. python_如何为元组中每个元素命名

    学生信息系统: (名字,年龄,性别,邮箱地址) 为了减少存储开支,每个学生的信息都以一个元组形式存放 如: ('tom', 18,'male','tom@qq.com' ) ('jom', 18,'m ...