"Turn" Android Source Learning (2) version management with Git and repo

Source: Internet
Author: User
Tags git commands

Original URL: http://blog.chinaunix.net/uid-26074270-id-2458828.html

Android projects use Git and repo for version management. In most cases, git can meet the needs of the user. However, because Android projects are too large, it is not easy to manage these 100 + git libraries in a simple and efficient way. Repo is based on this requirement, a partial encapsulation of GIT commands to simplify some cross-network operations.

Installing Repo

    • Create the directory where the repo is located and add the directory to the PATH environment variable
      1. $ mkdir ~/bin
      2. $ Path=~/bin: $PATH
    • Download the repo bootstrap script and give executable permissions
      1. $ Curl Https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
      2. $ chmod a+x ~/bin/repo
    • Create a working directory
      1. $ mkdir working_directory
      2. $ CD Working_directory
    • Initializing the Repo client
      1. $ repo init https://android.googlesource.com/platform/manifest-b ANDROID-4.0.1_R1
    • Get Source code synchronously
      1. $ repo Sync


Repo Basic Work Flow

    1. Create a new work branch using the Repo Start command
    2. Change code
    3. Use the git add command to notify Git of changes
    4. Commit changes using the git commit command
    5. Submit changes to the code review server using the Repo Update command

Repo command and Work flow chart Show
For more information, please refer to http://source.android.com/source/version-control.html

If you encounter the following error when repo sync:
    1. *initializing Project Platform/bionic ...
    2. Fatal: '. /platform/bionic.git ' does not appear to be a git repository
    3. Fatal:the remote end hung up unexpectedly
    4. Error:cannot Fetch platform/bionic*

Explain your repo long time no update, the solution is very simple, update the Repo tool, and new source directory, re-execute repo init and repo sync.

"Turn" Android Source Learning (2) version management with Git and repo

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.