I am trying to get the source code for the android os. How do I repo sync a particular folder from the master branch?
Asked
Active
Viewed 3.0k times
1 Answers
15
Partial checkouts are not supported with Git.
You could try using git-subtree for, after cloning the all repo, splitting part of that repo into your own project repo.
That said, if you are talking about one of the "projects" in the Android, they are Git repos, and can be managed with the tool "repo".
See also "Where can I browse Android source code on-line?"
Installing Repo:
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
$ mkdir working-directory-name
$ cd working-directory-name
$ repo init -u https://android.googlesource.com/platform/manifest
Synchronizing your client
To synchronize the files for all available projects:
$ repo sync
To synchronize the files for selected projects:
$ repo sync project1 project2 ...

Vadim Kotov
- 8,084
- 8
- 48
- 62

VonC
- 1,262,500
- 529
- 4,410
- 5,250
-
1How can I list available projects in repo? – endryha Dec 08 '11 at 20:32
-
1@endryha: I have fixed the links in that answer and added some source of information for listing Android projects and browsing their code sources. – VonC Dec 08 '11 at 21:13
-
4listing all the project with `repo forall -c 'echo "$REPO_PATH -- $REPO_PROJECT"'` for more info see: https://groups.google.com/a/chromium.org/forum/?fromgroups=#!topic/chromium-os-dev/xBtwK0RqRws – 0x90 Apr 10 '13 at 12:49
-
@0x90 ok, I would still be interested in the exact title of that thread on groups.google.com. – VonC Apr 10 '13 at 12:50
-
How I wish I have seen it earlier!!! I download all the source, and delete lots of files from my disk to get free room. – RxRead Jul 20 '15 at 10:49