- 下記の前提として、${REPOS_ROOT} に .repo や各リポジトリの実体が配置されているものとする
- manifest の更新
$ cd ${REPOS_ROOT}/.repo/manifests
$ git co -b <local-branch> <remote-branch>
$ git pull
- manifest からリポジトリのエントリが削除されている場合、 .repo 以下の cache の容量が気になるなら、 cache を一旦消して取り直す。
$ cd ${REPOS_ROOT}/.repo
$ rm -rf projects project-objects; # cache の削除。これを実行すると次の repo sync ではある程度余計に時間が掛かる。
- manifest で管理されている各リポジトリの更新
$ cd ${REPOS_ROOT}
$ rm -rf * # .repo 以外を全て消す。 manifest から削除された物がある場合には必要な手順となる
$ repo sync # ここで、 checkout 済の branch があっても、場合によってはその branch から detach されることがある。
$ repo forall "git checkout <local-branch>; git fetch --unshallow; git fetch --all; git merge"
- "--unshallow" オプションは、 git pull でも使用出来る。このオプションは、 manifest に clone-depth="1" と記述されてるリポジトリに対して、他の通常のリポジトリと同様、最新まで全ての履歴を local に取得しようとする。 clone-depth が指定されているリポジトリがなければ実行しなくてよい。