如何在 Git 项目之间共享 Android Studio 模块
How to share Android Studio modules between projects with Git
到目前为止,我一直在使用 Eclipse + SVN 和典型的项目 App + 项目库。
我使用具有以下结构的单个 SVN 存储库:
root
-Apps
-App1
-trunk
-tags
-branches
-Libs
-Lib1
-trunk
-tags
-branches
-Lib2
-trunk
-tags
-branches
我将项目移植到 Android Studio,我正尝试将模块存储在 Git 存储库中。我从 Git 开始,但我没有实现,似乎 git 准备每个存储库一个项目,不是吗?我该如何解决?
谢谢
Git 已准备就绪,只需使用 git 子模块即可。将您的项目分离到不同的存储库中,然后 link 将它们作为子模块组合在一起,让我为您指明指南:
http://git-scm.com/book/en/v2/Git-Tools-Submodules
例如,如果您在项目 A 中并且想要添加项目 B,请执行:
git submodule add https://github.com/myrepo/B
然后做:
$ git submodule init
$ git submodule update
到目前为止,我一直在使用 Eclipse + SVN 和典型的项目 App + 项目库。
我使用具有以下结构的单个 SVN 存储库:
root
-Apps
-App1
-trunk
-tags
-branches
-Libs
-Lib1
-trunk
-tags
-branches
-Lib2
-trunk
-tags
-branches
我将项目移植到 Android Studio,我正尝试将模块存储在 Git 存储库中。我从 Git 开始,但我没有实现,似乎 git 准备每个存储库一个项目,不是吗?我该如何解决?
谢谢
Git 已准备就绪,只需使用 git 子模块即可。将您的项目分离到不同的存储库中,然后 link 将它们作为子模块组合在一起,让我为您指明指南:
http://git-scm.com/book/en/v2/Git-Tools-Submodules
例如,如果您在项目 A 中并且想要添加项目 B,请执行:
git submodule add https://github.com/myrepo/B
然后做:
$ git submodule init
$ git submodule update