Android Branch and Master source code merge (patch)

Source: Internet
Author: User

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.







Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.