使用 repo 管理工程代码,需要切换不同仓库和不同分支,记录如下
需要在原有 repo 中增加其他工程指定分支代码
下载指定
repo manfiest,指定分支git clone ssh://git@ip/to/manifests.git cd manifests git checkout origin/$SOURCE $SOURCEdefault.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到指定分支$SOURCEgit add default.xml git commit -m "add some projects" git pushrepack对松散对象进行打包ssh git@ip -t /home/git/repac