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

Sequence of events to fix and push git merge conflicts

我刚刚将 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 吗?或者我还需要做其他事情吗(如果需要,顺序是什么)?

你可以这样做 git 添加 --all, git commit -m "comments"然后 git 推送原始功能