【问题标题】:"git pull" stopped merging automatically“git pull”自动停止合并
【发布时间】:2017-04-06 18:03:12
【问题描述】:

git pull 的行为最近已停止自动合并我当前签出的分支。每次拉后我都必须打电话给git merge。如果我运行git pull origin branch_name,它会很好地合并。

这是我的配置文件的相关部分。

[core]
    repositoryformatversion = 0
    filemode = false
    logallrefupdates = true
    editor = /bin/vim.exe
    autocrlf = true
    whitespace = --get
    bare = false
[remote "origin"]
    url = git@bitbucket.org:xxx/xxx.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[merge]
    edit = no
[pull]
    edit = no
[merge]
    edit = no
[branch "branch_name"]
    remote = origin
    merge = refs/heads/branch_name

【问题讨论】:

  • 你使用的是什么版本的 Git?
  • 我使用的是 2.8.3

标签: git merge pull


【解决方案1】:

你的 git 版本从 1.X 升级到 2.X 了吗?

https://git.kernel.org/pub/scm/git/git.git/tree/Documentation/RelNotes/2.0.0.txt

Git v2.0 发行说明

向后兼容性说明

git push [$there] 没有说要推送什么时,我们使用了 传统的matching 语义到目前为止(你所有的分支都被发送了 到远程只要已经有同名的分支 在那边)。在 Git 2.0 中,现在默认是 simple 语义, 哪个推动:

  • 只有当前分支到同名分支,并且只有 当前分支设置为与该远程集成时 分支,如果您推送到与您获取相同的远程;或

  • 只有当前分支到同名分支,如果你 正在推送到您通常不从那里获取的远程。

你可以使用配置变量push.default来改变 这个。如果您是一位想要继续使用 matching语义,可以将变量设置为matching,为 例子。阅读文档以了解其他可能性。

【讨论】:

  • 这几乎感觉像是一个答案,但更多的是问一个澄清问题而不是其他任何事情。如果您可以使这个更客观,那么作为答案就可以了。
  • 我正在运行 git 2.8.3
猜你喜欢
  • 2014-04-14
  • 1970-01-01
  • 2017-03-26
  • 2012-05-13
  • 2020-07-25
  • 2013-05-26
  • 2021-12-05
  • 1970-01-01
  • 2017-10-18
相关资源
最近更新 更多