1. 如何查看本地Android代码的分支信息,以及查看更多的分支
git --git-dir=.repo/manifests/.git/ branch -av
remotes/m/lineage-15.1 -> origin/lineage-15.1
remotes/origin/lineage-15.1 5f30c52 Track our own fork(s) for 2021-07 ASB patching
remotes/origin/lineage-16.0 ba8713c Track our own fork(s) for 2021-08 ASB patching
remotes/origin/lineage-17.1 ae706e7 Track our own fork(s) for 2021-08 ASB patching
2. 切换分支版本
repo init -b gingerbread-release
3.如果本地版本库中的源代码有一些改动,执行repo sync命令后,会出现错误,执行重置
repo forall -c git reset --hard remotes/origin/xxxxxxx
repo forall -c git xxxxxxx
repo sync