查看可切换的分支
cd .repo/manifests
git branch -a | cut -d / -f 3
以 gingerbread-release 分支为例
repo init -b android-4.1.2_r1
repo sync (not needed if your local copy is up to date)
repo start android-4.1.2_r1 --all
查看当前的分支
repo branches
error: external/valgrind/: platform/external/valgrind checkout d5d3abcc16492e823e09201a56a7d8c991e194d9
error: prebuilt/: platform/prebuilt checkout 4046d154f6b6d0722a7c1199e4be9322531cb3ca
wv@LiXia_PC ~/Android-4.0.0_r1
$ ~/bin/repo branches
* android-4.1.2_r1 | not in bionic, external/valgrind, prebuilt
报错了,没有全部转完!
查看当前所有分支:git branch -a
把所有的库切换分支: repo forall -c git checkout branch_name
删除所有库的某个分支: repo forall -c git branch -D branch_name- $ ~/bin/repo sync -j1
- remote: Counting objects: 597, done
- remote: Finding sources: 100% (4/4)
- remote: Total 4 (delta 2), reused 4 (delta 2)
- Unpacking objects: 100% (4/4), done.
- From https://android./platform/build
- 923ac1a..a1fd8e4 master -> aosp/master
- Fetching projects: 100% (293/293), done.
- info: A new version of repo is available
- object 45d21685b93f80b67239849b2d2cfe6b217e335a
- type commit
- tag v1.12.2
- tagger Shawn Pearce <sop@google.com> 1362159402 -0800
- repo 1.12.2
- error: cannot run gpg: No such file or directory
- error: could not run gpg.
- error: could not verify the tag 'v1.12.2'
- warning: Skipped upgrade to unverified version
- Syncing work tree: 0% (2/293) error: Your local changes to the following files would be overwritten by checkout:
- libc/kernel/common/linux/netfilter/xt_CONNMARK.h
- libc/kernel/common/linux/netfilter/xt_MARK.h
- libc/kernel/common/linux/netfilter_ipv6/ip6t_HL.h
- Please, commit your changes or stash them before you can switch branches.
- Aborting
- Syncing work tree: 55% (162/293) error: Your local changes to the following files would be overwritten by checkout:
- main/docs/html/FAQ.html
- Please, commit your changes or stash them before you can switch branches.
- Aborting
- Syncing work tree: 90% (264/293) error: Your local changes to the following files would be overwritten by checkout:
- linux-x86/toolchain/i686-linux-glibc2.7-4.4.3/sysroot/usr/include/linux/netfilter/xt_CONNMARK.h
- linux-x86/toolchain/i686-linux-glibc2.7-4.4.3/sysroot/usr/include/linux/netfilter/xt_DSCP.h
- linux-x86/toolchain/i686-linux-glibc2.7-4.4.3/sysroot/usr/include/linux/netfilter/xt_MARK.h
- linux-x86/toolchain/i686-linux-glibc2.7-4.4.3/sysroot/usr/include/linux/netfilter/xt_TCPMSS.h
- linux-x86/toolchain/i686-linux-glibc2.7-4.4.3/sysroot/usr/include/linux/netfilter_ipv4/ipt_CONNMARK.h
- linux-x86/toolchain/i686-linux-glibc2.7-4.4.3/sysroot/usr/include/linux/netfilter_ipv4/ipt_DSCP.h
- linux-x86/toolchain/i686-linux-glibc2.7-4.4.3/sysroot/usr/include/linux/netfilter_ipv4/ipt_ECN.h
- linux-x86/toolchain/i686-linux-glibc2.7-4.4.3/sysroot/usr/include/linux/netfilter_ipv4/ipt_MARK.h
- linux-x86/toolchain/i686-linux-glibc2.7-4.4.3/sysroot/usr/include/linux/netfilter_ipv4/ipt_TCPMSS.h
- linux-x86/toolchain/i686-linux-glibc2.7-4.4.3/sysroot/usr/include/linux/netfilter_ipv4/ipt_TOS.h
- linux-x86/toolchain/i686-linux-glibc2.7-4.4.3/sysroot/usr/include/linux/netfilter_ipv4/ipt_TTL.h
- linux-x86/toolchain/i686-linux-glibc2.7-4.4.3/sysroot/usr/include/linux/netfilter_ipv6/ip6t_HL.h
- linux-x86/toolchain/i686-linux-glibc2.7-4.4.3/sysroot/usr/include/linux/netfilter_ipv6/ip6t_MARK.h
- Please, commit your changes or stash them before you can switch branches.
- Aborting
- Syncing work tree: 100% (293/293), done.
- error: bionic/: platform/bionic checkout f57514eb59747171f55cd9b4abb064f1a474d5ee
- error: external/valgrind/: platform/external/valgrind checkout d5d3abcc16492e823e09201a56a7d8c991e194d9
- error: prebuilt/: platform/prebuilt checkout 4046d154f6b6d0722a7c1199e4be9322531cb3ca
Fetching projects: 100% (293/293), done.
fatal: bad config file line 1 in .git/config
Traceback (most recent call last):
File "/home/wv/android/source/.repo/repo/main.py", line 414, in <module>
_Main(sys.argv[1:])
File "/home/wv/android/source/.repo/repo/main.py", line 390, in _Main
result = repo._Run(argv) or 0
File "/home/wv/android/source/.repo/repo/main.py", line 138, in _Run
result = cmd.Execute(copts, cargs)
File "/home/wv/android/source/.repo/repo/subcmds/sync.py", line 630, in Execute
project.Sync_LocalHalf(syncbuf)
File "/home/wv/android/source/.repo/repo/project.py", line 1086, in Sync_LocalHalf
lost = self._revlist(not_rev(revid), HEAD)
File "/home/wv/android/source/.repo/repo/project.py", line 2006, in _revlist
return self.work_git.rev_list(*a, **kw)
File "/home/wv/android/source/.repo/repo/project.py", line 2155, in rev_list
p.stderr))
error.GitError: platform/bionic rev-list ('^f57514eb59747171f55cd9b4abb064f1a474d5ee', 'HEAD', '--'): fatal: bad config file line 1 in .git/config
wv@wv-ThinkPad-SL:~/android/source$