git 回购同步特定文件夹
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2130283/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Repo Sync a particular folder
提问by Gidiyo
I am trying to get the source code for the android os. How do I repo sync a particular folder from the master branch?
我正在尝试获取 android 操作系统的源代码。如何从 master 分支 repo 同步特定文件夹?
回答by VonC
Partial checkouts are not supported with Git.
Git 不支持部分签出。
You could try using git-subtreefor, after cloning the all repo, splitting part of that repo into your own project repo.
您可以尝试使用git-subtree在克隆所有存储库后,将该存储库的一部分拆分为您自己的项目存储库。
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?"
也就是说,如果您谈论的是 Android中的“项目”之一,则它们是 Git 存储库,可以使用工具“存储库”进行管理。
另请参阅“在哪里可以在线浏览 Android 源代码?”
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 ...