When I wanted to get Android source code, I knew that I have to use "repo". So what is repo? Why do they use repo and not just use GIT?, and is there a GUI for repo that enables me to pause/resume syncing, because every time I get disconnected occasionally it seems that repo starts syncing from the beginning!
5 Answers
As is mentioned in the android webpage, repo
does not replace git
. It is just a tool over git
and helps you to manage multiple git repositories.
For example, suppose I have a big project which has a lot of features and I have several teams working on each feature and I created one repository for each feature. For example suppose my repositories are wifi
, telephony
, power management
, etc. This action has sense when your features have different life cycles. For example if I won't touch the wifi
feature in my next release and but I will modify all the rest. So under this scenario, my project or product is distributed in several different git repositories.
So, to get a centralized photo of my project (one specific moment of my project, for example a milestone), I need to get the revision (git hash or tag) of each repository. Remember that we have one repository for each feature. Manually I could do it but could be very painful. So, with repo you can have one MANIFEST
which links to all the revisions of each git repo (one for each feature) and have an specific picture of my whole project.
Simply, I could say that is a way to manage centralized multiple git repositories which are decentralized.
With repo you have more features, not only to checkout at a specific point. For more info go to http://source.android.com/source/using-repo.html.

- 15,127
- 10
- 89
- 104

- 509
- 6
- 11
Repo and git - what they are, what they are for - is explained on source.android.com
To work with the Android code, you will need to use both Git and Repo.
Git is an open-source version-control system designed to handle very large projects that are distributed over multiple repositories. In the context of Android, we use Git for local operations such as local branching, commits, diffs, and edits.
Repo is a tool that we built on top of Git. Repo helps us manage the many Git repositories, does the uploads to our revision control system, and automates parts of the Android development workflow. Repo is not meant to replace Git, only to make it easier to work with Git in the context of Android. The repo command is an executable Python script that you can put anywhere in your path.
There's no GUI for Repo, as far as I can tell, but there's quite a bit of guidance on the site above for controlling what Repo is doing from the command line.
-
2http://source.android.com/source/developing.html : corrext url as of this posting date – RichieHH Nov 10 '13 at 11:14
-
@eibrahim could you elaborate? (I'm interested in using Repo for my own project, would like to hear feedbacks...) – Zvika Feb 29 '16 at 07:43
-
3I am no expert on it. I joined a project that is using it. the learning curve is steep and the way things are wired is very counter intuitive and seems over engineered. Maybe it is the way we are using it but I really don't like it and it seems like other developers share my views. I would recommend just plain git and perhaps sub-modules if you have multiple repos. sorry for not being too specific but like I said, I am no expert - just a disgruntled user/developer. – Emad Feb 29 '16 at 11:07
-
3I definitively confirm eibrahim opinion. `repo` adds a level of complexity to `git` which is already very complex. Moreover, many basic commands are not implemented in `repo` (like `log` or `rebase`) and you will have to write your own scripts above `repo` if you want to work normally (doing a sync with local changes is complicated with `git`, with `repo` this is WWII). Another example: `repo` will put the gits underneath in detached states, which will make them more difficult to manage. – calandoa Jun 01 '16 at 15:14
Concerning the pause and restart point, whilst in a terminal window doing a repo sync you can hit, "ctrl + z" to pause the repo sync. To restart simply type "fg" into the same window.

- 31
- 1
Go to:
http://source.android.com/source/git-repo.html
and you can download the repo
script. It is a Python script that uses the git
command to do distributed source code revision.
After you have executed repo sync
, do a ps -auwf
to see the processes:
For mine I saw:
\_ python -E /sde3/root/download/android/android/.repo/repo/main.py --rep \_ git fetch korg \_ git fetch korg \_ git index-pack --stdin -v --fix-thin --keep=fetch-pack 5227 on
Yes, repo sync
breaks often. But it is robust, just restart the command and it will resuming syncing again - those that have been updated will not be re-applied, so it will skip over them and continue with the rest.

- 133
- 2
- 10

- 6,337
- 4
- 42
- 58
repo sync has various useful options:
-f recovers from disconnects
-c just uploads the branch you asked for
-j <#CPUS> speeds up the sync by increasing the number of cpus used by the command

- 119
- 1
- 2