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
- $ mkdir ~/bin
- $ Path=~/bin: $PATH
- Download the repo bootstrap script and give executable permissions
- $ Curl Https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
- $ chmod a+x ~/bin/repo
- Create a working directory
- $ mkdir working_directory
- $ CD Working_directory
- Initializing the Repo client
- $ repo init https://android.googlesource.com/platform/manifest-b ANDROID-4.0.1_R1
- Get Source code synchronously
- $ repo Sync
Repo Basic Work Flow
- Create a new work branch using the Repo Start command
- Change code
- Use the git add command to notify Git of changes
- Commit changes using the git commit command
- 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:
- *initializing Project Platform/bionic ...
- Fatal: '. /platform/bionic.git ' does not appear to be a git repository
- Fatal:the remote end hung up unexpectedly
- 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