代码之家  ›  专栏  ›  技术社区  ›  Johan Hjalmarsson

gittattributes-合并一个特定目录(现有repo)

  •  0
  • Johan Hjalmarsson  · 技术社区  · 6 年前

    抱歉,如果这是重复的。我找过了,但没有找到任何有用的东西。

    我有一个git回购,是建立和运行的历史,不同的分支等。

    回购没有预先存在的 .gitattribute

    我的 .git属性 位于根文件夹中,包含以下内容:

    #I've tried the following:
    #./src/views/component-testing -merge
    #./src/views/component-testing/*.* -merge
    
    #Current content:
    ./src/views/component-testing/* -merge
    

    > git merge conflicting-branch
    Auto-merging src/views/component-testing/component-testing.tsx
    CONFLICT (content): Merge conflict in src/views/component-testing/component-testing.tsx
    

    1 回复  |  直到 6 年前
        1
  •  1
  •   Edward Thomson    6 年前

    这里有三个问题:

    1. -merge 属性 .gitattributes 文件,它不属于 .gitignore

    2. -合并

    3. 文件一旦签入到存储库,就不能被忽略。如果由于在两个不同的分支中更改了文件而导致合并冲突,则需要以某种方式解决该冲突。你可以随时 他们的 但你必须采取行动。

    推荐文章