repo sync过程中产生冲突的解决流程

repo sync后的结果:

Auto-merging services/tvservice/libtvsystem/system/SystemClient.cpp
Auto-merging services/tvservice/libtvsystem/system/ISystem.cpp
CONFLICT (content): Merge conflict in services/tvservice/libtvsystem/system/ISystem.cpp
Auto-merging services/tvservice/libtvservice/System.cpp
Auto-merging include/services/tvservice/SystemClient.h
Auto-merging include/services/tvservice/System.h
Auto-merging include/services/tvservice/ISystem.h
Auto-merging include/appclass/TvApi/ISystemControl.h
Auto-merging appclass/TvApi/CSystemControl.h
Auto-merging appclass/TvApi/CSystemControl.cpp
Recorded preimage for 'services/tvservice/libtvsystem/system/ISystem.cpp'
Failed to merge in the changes.
Patch failed at 0001 [ANDROIDTV][Factory Menu] add function for audio hal


When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To check out the original branch and stop rebasing run "git rebase --abort".


1.首先查看冲突的文件:

CONFLICT (content): Merge conflict in services/tvservice/libtvsystem/system/ISystem.cpp

ISystem.cpp 自动merge的时候产生了冲突,本地对ISystem.cpp的修改与远程端的修改结果无法自动merge。

使用git status查看:

$ git status
# Not currently on any branch.
# Changes to be committed:
#   (use "git reset HEAD ..." to unstage)
#
#       modified:   appclass/TvApi/CSystemControl.cpp
#       modified:   appclass/TvApi/CSystemControl.h
#       modified:   include/appclass/TvApi/ISystemControl.h
#       modified:   include/services/tvservice/ISystem.h
#       modified:   include/services/tvservice/System.h
#       modified:   include/services/tvservice/SystemClient.h
#       modified:   services/tvservice/libtvservice/System.cpp
#       modified:   services/tvservice/libtvsystem/system/ISystemParcelPacker.cpp
#       modified:   services/tvservice/libtvsystem/system/SystemClient.cpp
#
# Unmerged paths:
#   (use "git reset HEAD ..." to unstage)
#   (use "git add/rm ..." as appropriate to mark resolution)
#
#       both modified:      services/tvservice/libtvsystem/system/ISystem.cpp
#

2.打开文件,解决冲突:

打开 ISystem.cpp文件:

<<<<<<<<<< 服务器端更新过来的代码块A
==============
本地修改的代码块B
>>>>>>>>>>>{你的commit的名字}
手动修改,将不需要的东西删掉,使文件变成正常的.cpp .c .h或.java文件,保存。

3.git add将修改的文件添加进来。

4.git rebase --continue

5.若还有冲突继续重复2-4,没有冲突则完成。

----------------------------

今天做git rebase的时候也遇到冲突,解决流程与repo sync一致。目前还没有机会自己merge,估计merge的时候产生冲突也是一样的流程。

你可能感兴趣的:(工作笔记)