Android repo command and switching branches

后端 未结 2 700
面向向阳花
面向向阳花 2020-12-24 07:04

I feel I have a pretty good understanding of git, but when it comes to the repo command, I get lost. I\'ve read about the repo command, but I\'m still not sure how it ties

相关标签:
2条回答
  • 2020-12-24 07:44

    If you run repo init a second time with a different branch, you can simply repo sync and it will not download the entire source code again.

    0 讨论(0)
  • 2020-12-24 08:01

    The repo -b parameter specifies the branch of the .repo/manifests git repository that should be checked out. The default.xml file in this repository defines which branch each of the other git repositiories (projects) should be on.

    It seems that repo is written in such a way that if you check out another manifest branch are repo sync again it will pull all the code again over the network.

    You can run repo forall -c 'git checkout branch_name' which will checkout the specified branch for all projects that are declared in your current manifest but if there are projects added/removed between gingerbread and ics (which there are), then you won't get the code for these projects.

    Running git checkout branchname in the .repo/manifests repository then running repo sync may enable you to save some network overhead.

    Otherwise, due to the limitations of repo, the only real way to do it is to maintain two working copies of the aosp or be prepared to re-sync.

    0 讨论(0)
提交回复
热议问题