2.repo sync 源码出现错误部分解决方法

repo sync
出现错误
error: .repo/manifests/: contains uncommitted changes
解决方法:
de>cd .repo/manifests
git stash
git clean -f -d

repo sync中途出现error: error: Exited sync due to fetch errors
解决方法:
repo sync -jx -f --force-sync x的数值根据你电脑的配置来决定

Fetching projects: 100% (228/228), done.

Checking out files: 100% (18905/18905), done. files: 23%
(4359/18905)
Checking out files: 100% (4664/4664), done.
Checking out files: 100% (9386/9386), done.out files: 0% (2/9386)
Checking out files: 100% (5365/5365), done.
Checking out files: 100% (292/292), done.g out files: 5% (16/292)
Checking out files: 100% (41/41), done.ing out files: 4% (2/41)
Syncing work tree: 35% (80/228) fatal: This operation must be run in
a work tree
Traceback (most recent call last):
File "/home/christian/Documents/yum/.repo/repo/main.py", line 366,
in
_Main(sys.argv[1:])
File "/home/christian/Documents/yum/.repo/repo/main.py", line 346,
in _Main
result = repo._Run(argv) or 0
File "/home/christian/Documents/yum/.repo/repo/main.py", line 137,
in _Run
result = cmd.Execute(copts, cargs)
File "/home/christian/Documents/yum/.repo/repo/subcmds/sync.py",
line 443, in Execute
project.Sync_LocalHalf(syncbuf)
File "/home/christian/Documents/yum/.repo/repo/project.py", line
975, in Sync_LocalHalf
self._InitWorkTree()
File "/home/christian/Documents/yum/.repo/repo/project.py", line
1758, in _InitWorkTree
raise GitError("cannot initialize work tree")
error.GitError: cannot initialize work tree

运行以下命令:

repo --trace sync -l

如果还报错,就删掉最后一个报错的文件
rm -rf xxxxxxxxxx

你可能感兴趣的:(2.repo sync 源码出现错误部分解决方法)