Environment:android 4.4.2 Merge with Android 4.4.3 (with other vendors source code)
1. Determine the version you want to merge into the other branch, and find the commit ID for the patch to the target code in the server test for the specific lable corresponding commit or repo Manifest from the build
<?xml version= "1.0" encoding= "UTF-8"?><manifest> <remote fetch= ":" Name= "Aosp"/> < Default remote= "Aosp" revision= "main-4.4" sync-j= "4"/> <project groups= "Device,flo" Name= "Device/asus/deb "Revision=" 76428ec8349ae0d73455fa4b248bcc7375e08243 "upstream=" main-4.4 "/> <project groups=" Device,flo "Name=" Device/asus/flo "revision=" 3200b077a36c68e20cafef250ff70b7d36f71409 "upstream=" main-4.4 "/> < Project groups= "Device,flo" name= "Device/asus/flo-kernel" revision= "b964b854c791be15514d9c8b950531981a81365c" upstream= "main-4.4"/>
Take "Devcie, Flo" As an example: revision= "76428ec8349ae0d73455fa4b248bcc7375e08243", 76428ec8349ae0d73455fa4b248bcc7375e08243 the latest commit ID that requires patches
2. Making Patch Packages
git diff--binary org_commit_id 76428ec8349ae0d73455fa4b248bcc7375e08243 > Device-flo.patch can be generated from org_commit_id to Patch for code changes between 76428ec8349ae0d73455fa4b248bcc7375e08243
3. Detect if code is conflicting
Go to the source code directory that requires patches and execute git apply--check device-flo.patch
If there is a conflict, you will be prompted with an error, otherwise there are no errors.
4. Patch the contents of the patch to the target source code and generate a conflict record
git apply--reject Devcie-flo.patch
If a file conflicts, you will generate a A.rej file in the directory that corresponds to a file, and open a A.rej file to view the specific error message.
5. Manual Merge conflict content
You can use the Meld tool to compare the source code in the target directory with the patch. The merge code is based on the code logic.