【写在前面】
网上资料梳理,侵删烦请联系。或有表达错误,欢迎指出纠正。
【参考引用】
https://blog.youkuaiyun.com/qq_27061049/article/details/81096714
repo
repo配置
1)创建SSH-key公钥
命令:ssh-keygen -t rsa -C yourEmailAddress@**.com
操作:一直enter
2)登录gerrit账号
①登录gerrit账号;
②gerrit上添加公共密钥。Settings -> SSH Public Keys -> Add Key
③:~$ 路径下进入.ssh目录。id_rsa为密钥,id_rsa.pub为公钥
cat id_rsa.pub获取公钥内容,并将其copy至gerrit add key上。
3)修改或创建.ssh/config
~/.ssh$ cat config
Host *
User <Annie
>
IdentityFile ~/.ssh/id_rsa
4)配置config git ~/.gitconfig
①sudo apt-get install git
②git config –global user.email “your email”
③git config –global user.name “your username”
④查看 ~/.gitconfig 文件配置的是否正确
⑤修改config权限。sudo chmod 644 config
~$ cat .gitconfig
[user]
name = <name
>
email = <youremail
>
[color]
ui = auto
5)配置repo文件
①mkdir ~/bin
②拷贝repo文件至bin文件下
③更改repo权限
sudo chmod 777 repo
④添加全局变量
$ sudo vi ~/.bashrc
添加新的一行:
export PATH = $PATH:~/bin
source ~/.bashrc
注:可复制配置完成的文件
⑥拉取代码