`
Harry642
  • 浏览: 24216 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Git 2.0 更改 push default 为‘simple’

阅读更多
如果你最近更新了 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


文章引用自:http://www.oschina.net/news/45585/git-2-x-change-push-default-to-simple
分享到:
评论

相关推荐

    Git push 常见用法

    通过执行 `git push`,开发者能够将本地所做的修改、新添加的文件或者对现有文件的更改同步到远程仓库中,从而与其他团队成员共享自己的工作成果。下面我们将详细介绍 `git push` 的各种用法。 #### 基本语法与解释...

    Git发现git push origin master 报错的解决方法

    在Git 2.0之前,默认的推送行为是`matching`,而在Git 2.0及之后版本默认行为更改为`simple`。如果需要保持原有的`matching`行为,可以使用以下命令进行全局配置:`git config --global push.default matching`。...

    个人总结搭建git服务器仓库采用无密登录方式以及TortoiseGit的用法

    用户也可以定义其他配置项,如 git config --global push.default simple。 7. Git 和 SVN 的用户区别 Git 和 SVN 都是版本控制系统,但它们的用户机制不同。SVN 的用户名密码是在服务器上配置好的,而 Git 的...

    git常用命令总结 word文档

    - **说明**: 使用`git config push.default simple`可以设置默认推送分支的行为,这里设置为简单的模式,即只推送当前所在的分支。 **13.2 生成压缩包** - **命令**: `git archive --format=tar --output=archive....

    git代码管理工具使用方法及常用配置

    可以通过 git config --global push.default 来修改默认行为。 最后,为了方便用户使用,Git提供了克隆仓库的功能。在克隆远程仓库之前,需要配置SSH公钥,将生成的公钥复制并粘贴到码云账号中。克隆命令 ***:x_h_j...

    git2.21.0版本安装包(包括64和32bit的) 以及.gitconfit文件

    default = simple ``` 设置推送时的默认行为,例如只推送当前分支。 5. 全局忽略文件: ``` [core] excludesfile = ~/.gitignore_global ``` 指定一个全局的忽略文件,避免在各个项目中重复设置。 6. 代码...

    Git-2.21.0-64-bit.zip

    * The "git log" command by default behaves as if the --mailmap option was given. UI, Workflows & Features * The "git fast-export/import" pair has been taught to handle commits with log messages...

    Git 常用命令

    `git config --global push.default simple`** - **功能描述**:设置默认推送模式为简单模式(simple)。 - **应用场景**:在进行推送操作时,避免每次都需要指定分支名的情况。当设置为simple模式后,默认会将...

    IFT220_Lab2:仅用于在我在ASU的配置管理和Active Directory课程中教授Git和PowerShell

    IFT 220实验2对于ASU的IFT 220 2018秋季B课程。...- global user.name < your>git config -- global user.email < your>git config -- global push.default simple# Install Posh-GitInstall-Module

    intraX:翻新42school Intranet,NodeJS + Angular

    ## Install克隆存储库: git clone https://github.com/akabab/intraX.git 获取项目依赖项: npm install * /!*在项目文件夹中执行此操作 ... ##使用git push推送当前分支-> git config --global push.default simple

    provisions:TangoMan Provisions是一个很棒的纯Shell脚本集合,用于设置您的计算机

    $ git config --global push.default simple 设置vim为git默认编辑器 $ git config --global core.editor ' vim ' :high_voltage: 初始化git子模块 为了下载项目子模块,请输入以下命令 $ git submodule upd

    java8看不到源码-dev-workflow-skeleton:开发工作流骨架

    push.default "simple" git config --global pull.rebase true git config --global url."https://".insteadOf git:// git config --global credential.helper 'cache --timeout=18000' 安装编辑器,例如 sudo add-...

    maven-samples:玩弄Maven

    描述中提到了 "git config --global push.default simple",这是 Git 的配置命令,用于设置默认的 push 行为。当设置为 "simple" 时,Git 只会推送当前分支到远程的同名分支,这是一个推荐的安全设置,防止意外地推...

    android-viewflow

    Create a feature branch, push the branch to git hub, press Pull Request and write a simple explanation. One fix per commit. If let's say a commit closes the open issue 12. Just add closes #12 in ...

    Python-使用AmazonSNS发送推送通知给移动设备

    Amazon SNS(Simple Notification Service)是亚马逊云服务提供的一种高度可扩展、完全托管的推送通知服务,它允许开发者向移动应用、电子邮件、SMS、HTTP服务器等发送消息。在本教程中,我们将深入探讨如何使用...

    Python-程序员工作中常见的英语词汇

    8. **版本控制词汇**:`version control`(版本控制),`Git`(Git),`commit`(提交),`branch`(分支),`merge`(合并),`pull request`(拉取请求),`repository`(仓库),`clone`(克隆),`push`(推送),`pull`(拉取)等。...

Global site tag (gtag.js) - Google Analytics