使用 repo
管理工程代码,需要切换不同仓库和不同分支,记录如下
需要在原有 repo
中增加其他工程指定分支代码
下载指定
repo manfiest
,指定分支git clone ssh://git@ip/to/manifests.git cd manifests git checkout origin/$SOURCE $SOURCE
default.xml
如下<manifest> <remote name="aosp" fetch="https://android.googlesource.com/"/> <default revision="master" remote="aosp" sync-j="4" /> <project path="art" name="platform/art" /> <project path="bionic" name="platform/bionic" groups="pdk" /> <project path="tools/adt/eclipse" name="platform/tools/adt/eclipse" groups="notdefault,tools" /> </manifest>
编辑
default.xml
,增加另一个仓库指定分支代码,remote
指定仓库,revision
指定分支或tag
<manifest> <remote name="aosp" fetch="https://android.googlesource.com/"/> <remote name="udinic" fetch="https://github.com/udinic/"/> <default revision="master" remote="aosp" sync-j="4" /> <project path="art" name="platform/art" /> <project path="bionic" name="platform/bionic" groups="pdk" /> <project path="dalvik" name="platform_dalvik” remote=“udinic”/> <project path="frameworks/base" name="platform_frameworks_base" remote=“udinic" revision=“statusbar_fixes"/> <project path="tools/adt/eclipse" name="platform/tools/adt/eclipse" groups="notdefault,tools" /> </manifest>
上传
default.xml
到指定分支$SOURCE
git add default.xml git commit -m "add some projects" git push
repack
对松散对象进行打包ssh git@ip -t /home/git/repac