Git 安装
-
安装git:
sudo apt-get install git-core -
初始化本地账户
git config --global user.name xian.lan
git config --global user.email xian.lan@thundersoft.com -
生生成SSH密钥
ssh-keygen -t rsa -C “youremail@thundersoft.com”
Gerrit服务器上添加公钥
添加id_rsa.pub内容到Gerrit服务器:
IE输入http://192.168.100.139/gerrit,进入页面点击右上角的sign in,输入域用户名,域密码,进入gerrit界面之后,点击姓名的下拉列表点settings,会进入如下页面,在列表中选择SSH public Keys,选择add key, 粘贴id_rsa.pub的内容
5.测试能否连接到gerrit服务器
ssh -p 29418 xian.lan@192.168.67.19
下载repo
新建一个文件夹,打开终端,执行命令git clone git://192.168.67.19/tools/repo.git -b stable
进行文件夹的移动
sudo mv repo /usr/bin
添加权限
sudo chmod a+x usr/bin/repo
下载代码
repo init -u ssh://xian.lan@192.168.167.19:29418/tequila/manifest -b tequila-dev
repo sync -c --no-tags -j3