repo init
repo init失败时,用一个本地账户可以,另一个本地账户不可以,基本上是配置问题。
repo init iu ssh://xxx.xxx.xxx.xxx:xxxx/projectName/manifest -b branchName --repo-url=ssh://xxx.xxx.xxx.xxx:xxxx/git-repo-version
常见的失败信息如下:
Perrmission denied(publickey).
fetal:Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
解决方法
1、repo init时指定用户信息
repo init iu ssh://username@xxx.xxx.xxx.xxx:xxxx/projectName/manifest -b branchName --repo-url=ssh://username@xxx.xxx.xxx.xxx:xxxx/git-repo-version
2、设置ssh的配置文件
为.ssh目录设置权限
chmod 600 ~/.ssh/config
config文件配置十分简单,只需要按照以下格式配置即可。
config文件需要放到 ~/.ssh/config
Hostwork1
HostName xxx.xxx.xxx.xxx
User root
Port xxxx
Hostwork2
HostName xxx.xxx.xxx.xxx
User root
Port xxxx
对指定的Project列表或所有Project执行命令COMMAND,加上-p参数可打印出Project的路径。
repo forall -c 'git reset --hard HEAD;git clean -df;git rebase --abort'