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'