代码之家  ›  专栏  ›  技术社区  ›  hotmeatballsoup

修复和推送git合并冲突的事件序列

  •  0
  • hotmeatballsoup  · 技术社区  · 7 年前

    我刚合并 develop 进入我的功能分支(通过 git merge develop )大约有20个合并冲突。当我做一个 git status 我看到的输出如下:

            new file:   src/test/resources/com/example/mapper/test/TestAccountMapper.xml
            new file:   src/test/resources/vc-import-data/DATAFILE-unwrapped.xml
            new file:   src/test/resources/vc-import-data/DATAFILE.xml
    
    Unmerged paths:
    (use "git add <file>..." to mark resolution)
    
            both added:      src/main/java/com/example/bean/Account.java
            both added:      src/main/java/com/example/bean/Address.java
            both added:      src/main/java/com/example/bean/Customer.java
            both added:      src/main/java/com/example/mapper/AccountMapper.java
            both added:      src/main/java/com/example/mapper/CountryMapper.java
            both added:      src/main/resources/com/example/mapper/AccountMapper.xml
            both added:      src/main/resources/com/example/mapper/AddressMapper.xml
            both added:      src/main/resources/com/example/mapper/CustomerMapper.xml
            both modified:   src/main/resources/endpoints.properties
            both added:      src/test/java/com/example/mapper/AccountMapperTest.java
            both added:      src/test/java/com/example/mapper/CustomerMapperTest.java
            both modified:   src/test/resources/test-endpoints.properties
    

    我现在已经检查了每个冲突的文件并手工合并了所有内容。我能做个 git add . && git commit -m "Resolved merge conflicts" && git push ? 或者我还需要做其他事情吗(如果需要,按什么顺序)?

    1 回复  |  直到 7 年前
        1
  •  1
  •   Shivam    7 年前

    你可以这样做 git add——全部, git commit-m“注释”,然后 git推送源功能