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!
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
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.
Go to:
http://source.android.com/source/git-repo.html
and you can download the
repo
script. It is a Python script that uses thegit
command to do distributed source code revision.After you have executed
repo sync
, do aps -auwf
to see the processes:For mine I saw:
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.As is mentioned in the android webpage,
repo
does not replacegit
. It is just a tool overgit
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 thewifi
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.
Repo and git - what they are, what they are for - is explained on source.android.com
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.
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