repo sync出错整理

  • repo sync出错整理
    • 1. 出现contains uncommitted changes错误
      • 1.1. 出现error: .repo/manifests/: contains uncommitted changes错误
      • 1.2. 出现error: .repo/repo/: contains uncommitted changes错误
    • 2. 出现了error: manifest missing or unreadable – please run init错误
    • 3. 出现error.GitError: manifests rev-list这样的错误
    • 4. 出现了repo sync时出现了.repo/manifests/: discarding 98 commits fatal: include star.xml doesn’t exist or isn’t a file。repo init时出现了fatal: cannot create default in manifest
    • 5. No space left on device
    • 6. 出现了main.py和sync.py,pickle.py,最后出现EOFError
    • 7. git clone出错:nonexistent ref, unable to checkout

repo sync出错整理

1. 出现contains uncommitted changes错误

1.1. 出现error: .repo/manifests/: contains uncommitted changes错误

原因:修改了.repo/manifests目录下的东西,但没提交导致的
解决方法:

$ cd .repo/manifests
$ git reset --hard HEAD~3
$ cd -
$ repo sync -f -d -j16

1.2. 出现error: .repo/repo/: contains uncommitted changes错误

原因:修改了.repo/repo目录下的东西,但没提交导致的
解决方法:

$ cd .repo/repo
$ git reset --hard HEAD~3
$ cd -
$ repo sync -f -d -j16

2. 出现了error: manifest missing or unreadable – please run init错误

repo sync出现如下错误
Fetching projects: 100% (571/571), done.
Syncing work tree: 83% (474/570) error: in sync -j32: [Errno 2] No such file or directory: u’/home/root/lmr1-master/packages/inputmethods/LatinIME/.git/HEAD’
error: manifest missing or unreadable – please run init
解法办法如下:

root@ubuntu:~/an$ rm packages/inputmethods/LatinIME -rf
root@ubuntu:~/an$ cd .repo/
root@ubuntu:~/an/.repo$ ls
manifests  manifests.git  manifest.xml  project.list  project-objects  projects  repo
root@ubuntu:~/an/.repo$ cd project-objects/platform
root@ubuntu:~/an/.repo/project-objects/platform$ rm packages/inputmethods/LatinIME.git/ -rf
root@ubuntu:~/an/.repo/project-objects/platform$ cd ..
root@ubuntu:~/an/.repo/project-objects$ cd ..
root@ubuntu:~/an/.repo$ cd projects/ 
root@ubuntu:~/an/.repo/projects$ rm packages/inputmethods/LatinIME.git/ -rf
root@ubuntu:~/an/.repo/projects$ cd ..
root@ubuntu:~/an/.repo$ cd manifests
root@ubuntu:~/an/.repo/manifests$ ls
default.xml  star.xml
root@ubuntu:~/an/.repo/manifests$ git reset --hard HEAD~2
HEAD is now at c3378ab Add audio_raw project
root@ubuntu:~/an/.repo/manifests$ cd ..
root@ubuntu:~/an/.repo$ cd ..
root@ubuntu:~/an$ repo sync -f -j32

3. 出现error.GitError: manifests rev-list这样的错误

repo sync出错log如下:
Traceback (most recent call last):
File “/home/an/.repo/repo/main.py”, line 500, in
_Main(sys.argv[1:])
File “/home/an/.repo/repo/main.py”, line 476, in _Main
result = repo._Run(argv) or 0
File “/home/an/.repo/repo/main.py”, line 155, in _Run
result = cmd.Execute(copts, cargs)
File “/home/an/.repo/repo/subcmds/sync.py”, line 614, in Execute
if mp.HasChanges:
File “/home/an/.repo/repo/project.py”, line 2669, in HasChanges
elif self._revlist(not_rev(HEAD), revid):
File “/home/an/.repo/repo/project.py”, line 2241, in _revlist
return self.work_git.rev_list(*a, **kw)
File “/home/an/.repo/repo/project.py”, line 2435, in rev_list
p.stderr))
error.GitError: manifests rev-list (‘^HEAD’, u’32e0fb4acc12235c71938356550c9552252a2f16’, ‘–’): fatal: bad object 32e0fb4acc12235c71938356550c95552a2f16
解法办法:

root@ubuntu:/home/an$ cd .repo/manifests
root@ubuntu:/home/an/.repo/manifests$ ls
default.xml  star.xml
root@ubuntu:/home/an/.repo/manifests$ git fetch
remote: Counting objects: 16, done
remote: Finding sources: 100% (9/9)
remote: Total 9 (delta 4), reused 8 (delta 4)
Unpacking objects: 100% (9/9), done.
From ssh://hcgit:29418/platform/manifest
   a70e9c6..32e0fb4  marshmallow-master -> origin/marshmallow-master
 * [new branch]      lmr1-rel -> origin/lmr1-rel
 * [new branch]      lmr1-maserati-dev -> origin/lmr1-maserati-dev
 * [new branch]      an3 -> origin/an3
   4068afa..c1aab5a  tif-dev    -> origin/tif-dev
root@ubuntu:/home/an/.repo/manifests$ git diff
root@ubuntu:/home/an/.repo/manifests$ cd ../..
root@ubuntu:/home/an$ repo sync

4. 出现了repo sync时出现了.repo/manifests/: discarding 98 commits fatal: include star.xml doesn’t exist or isn’t a file。repo init时出现了fatal: cannot create default in manifest

解法:

an$ cd .repo/
an/.repo$ rm manifest* -rf
an/.repo$ cd ..
an$ repo init -u ssh://hcgit:29418/platform/manifest -b lmr1-an-master
an$ repo sync -f -d -j32

5. No space left on device

出错:
Fetching projects: 100% (743/743), done.
Traceback (most recent call last):
File “/home/an/.repo/repo/main.py”, line 500, in
_Main(sys.argv[1:])
File “/home/an/.repo/repo/main.py”, line 476, in _Main
result = repo._Run(argv) or 0
File “/home/an/.repo/repo/main.py”, line 155, in _Run
result = cmd.Execute(copts, cargs)
File “/home/an/.repo/repo/subcmds/sync.py”, line 666, in Execute
if self.UpdateProjectList():
File “/home/an/.repo/repo/subcmds/sync.py”, line 474, in UpdateProjectList
fd.close()
IOError: [Errno 28] No space left on device

解法:

这个是因为所在的server没有空间了。。。删除一下东东,再重新去repo sync…..

6. 出现了main.py和sync.py,pickle.py,最后出现EOFError

出错log:
root@ubuntu:/home/an_1$ repo sync
Traceback (most recent call last):
File “/home/an_1/.repo/repo/main.py”, line 500, in
_Main(sys.argv[1:])
File “/home/an_1/.repo/repo/main.py”, line 476, in _Main
result = repo._Run(argv) or 0
File “/home/an_1/.repo/repo/main.py”, line 155, in _Run
result = cmd.Execute(copts, cargs)
File “/home/an_1/.repo/repo/subcmds/sync.py”, line 633, in Execute
to_fetch.sort(key=self._fetch_times.Get, reverse=True)
File “/home/an_1/.repo/repo/subcmds/sync.py”, line 768, in Get
self._Load()
File “/home/an_1/.repo/repo/subcmds/sync.py”, line 788, in _Load
self._times = pickle.load(f)
File “/usr/lib/python2.7/pickle.py”, line 1378, in load
return Unpickler(file).load()
File “/usr/lib/python2.7/pickle.py”, line 858, in load
dispatchkey
File “/usr/lib/python2.7/pickle.py”, line 880, in load_eof
raise EOFError
EOFError

解法:

root@ubuntu:/home/an2_1$ cd .repo/
root@ubuntu:/home/an2_1/.repo$ rm .repopickle_fetchtimes
root@ubuntu:/home/an_1$ repo sync 

7. git clone出错:nonexistent ref, unable to checkout

root@ubuntu:~/git/icecream$ git clone ssh://icecreamqiu@hcgit03:29418/star/icecream
Cloning into ‘icecream’…
Checking connectivity… done
warning: remote HEAD refers to nonexistent ref, unable to checkout.

原因:

没有权限,叫对应的git server owner开权限

你可能感兴趣的:(git)