【问题标题】:git: Cannot merge a file due to unknown .gitignore rulesgit:由于未知的 .gitignore 规则,无法合并文件
【发布时间】:2013-06-26 14:20:12
【问题描述】:

我正在合并一个文件,但在完成 3 路合并后,我看到了这个:

Normal merge conflict for 'myfile.ext':
  {local}: modified file
  {remote}: modified file
Hit return to start merge resolution tool (araxis): 
The following paths are ignored by one of your .gitignore files:
Installers
Use -f if you really want to add them.
fatal: no files added

git status 给出:

Unmerged paths:
#   (use "git reset HEAD <file>..." to unstage)
#   (use "git add <file>..." to mark resolution)
#
#       both modified:      myfile.ext

我试图找到 .gitignore 但没有结果。 有没有办法在我修复问题 .gitignore 文件之前强制合并?

【问题讨论】:

    标签: git version-control merge dvcs gitignore


    【解决方案1】:

    如果你想强制合并到特定分支see this question

    关于 gitignore 文件,下面给出了什么?

    git config --get core.excludesfile
    

    Installers 在里面吗?

    【讨论】:

    • 谢谢马克。我查看了您的链接,我想要与接受我们的或他们的不同的东西。我确实需要明确解决冲突然后签入。所以我真的必须在那个文件上运行 git mergetool 。您关于 core.excludesfile 的提示非常有帮助,我修复了忽略规则。谢谢!
    猜你喜欢
    • 1970-01-01
    • 2023-03-04
    • 1970-01-01
    • 1970-01-01
    • 2013-02-16
    • 1970-01-01
    • 2011-10-11
    • 2020-10-25
    • 1970-01-01
    相关资源
    最近更新 更多