repo常见问题

首先进行简单的repo介绍,在开发项目过程中repo可谓是神兵利器,repo是Android为了方便管理多个git库而开发出来的python脚本,方便开发者更好地利用git。

repo常用的指令有:init、sync、diff、status、forall....可以通过help了解更多功能,但是在使用repo过程中也会遇到许多问题,本文针对常用的repo int和repo sync常出现的一些问题进行自己的归纳和总结,日常学习总结仅作为参考。

repo init:

repo init子命令主要完成检出清单版本库(manifest.git),以及配置Git用户名和邮件地址的工作。

问题:

1、在init的过程中出现没有权限的问题

在企业项目开发过程中,需要使用到gerrit进行项目的管理,无法拉取说明在gerrit没有配置相应的公钥,所以问题定位在:

①是否在正确的gerrit中配置

②是否已经配置公钥

2、出现manifest missing or unreadable

 

 repo需要在自己需要运行的文件夹下面,有可能在home目录下面,先which repo查位置

发现在/home/***/bin/repo下面,在home下面ls -a发现repo真的在home目录下面,然后删除rm -rf .repo这样就可以正常init

未完待续。。。

repo sync:

1、fatal:cannot create at 'nn/untiome/test/generated/...':No space left on device

说明存放的文件夹空间不够,需清理出一些空间

2、error: .repo/manifests/: contains uncommitted changes

修改了代码但是没有提交,定位:修改的代码在 .repo/manifests/路径之下,先到当前目录下再进行再将修改的代码会退掉

git fetch --all

git reset --hard gerrit/s-huaihe-sm35-dev

git pull(可省略)
再回到项目根目录下进行repo sync

如果出现以下问题:rebase  still progress

进入到出错的目录下面:

Git branch -av查看状况rebasing s-huaihe...

删掉.git/rebase-apply,先cd .git-->ls---->rm-rf rebase-apply再回到项目根目录下同步即可

3、error.GitError: manifests rev-list

解决:

 

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、git clone的时候出错:nonexistent ref, unable to checkout

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

posted @ 2021-10-13 16:37  野蛮兔子  阅读(1472)  评论(0)    收藏  举报