Gerrit使用說明
Gerrit使用說明
1.登陸gerrit/,點右上角SignIn輸入用戶名密碼,登陸
2.登陸後,點擊用戶名,選擇setting
3.點擊左邊SSH Public Keys,出現一個Add SSH Public Key的界面
4.進入ubuntu或者在服務器自己文件夾下面命令行,執行ssh-keygen -t rsa -C lbc(郵箱前綴)
5.出現Enter file in which to save the key (/home/lbc/.ssh/id_rsa):
然後敲回車,如果之前生成過sshkey,則會出現是否覆蓋?選y。然後敲回車
6.提示輸入passphrase,可以留空,也可以輸入(類似密碼提示功能)。敲回車
7.如果第6步中輸入了passphrase,則重複一遍,否則,留空,敲回車,在第5步所提示的目錄中生成了ssh key,其中id_rsa爲祕鑰,id_rsa.pub爲公鑰,加密方式爲rsa
8.進入/home/lbc/.ssh下,打開id_rsa.pub,複製,並粘貼至第3步的對話框中,然後點Add。
7.執行chmod 600 /home/lbc/.ssh/id_rsa(服務器上面默認的就是600權限)
8.登陸http://172.16.27.54/gerrit/,點右上角SignIn輸入用戶名密碼,登陸
9.登陸後,點擊用戶名,選擇setting
10.點擊左邊SSH Public Keys,出現一個Add SSH Public Key的界面
11.將之前生成的id_rsa.pub中內容複製粘貼進當前界面的對話框中,然後點Add
12 在~/.ssh創建config文件,並把以下內容拷貝到裏面去,名字換成自己的,注意空格
host 172.16.27.54
User libaocheng
Port 29418
13你的根目錄創建.gitconfig文件,並拷貝以下文件到裏面,名字換成自己的
[user]
name = libaocheng
email = [email protected]
[color]
diff = auto
status = auto
branch = auto
[review "172.16.27.54/gerrit"]
username = libaocheng
14.進入本地work目錄下,mkdirproject,cd project
15.執行 repo init -u ssh://[email protected]:29418/MSD6369_GTV_AU/manifest.git--repo-url=ssh://[email protected]:29418/git-repo.git
14.成功後,會在當前文件夾下生成一個.repo文件夾,然後執行reposync,等待,整個工程便下載下來了。
以下爲附加值
//sync 當前branch
repo sync -c
//起新的branch usbupdate
repo start usbupdate --all
//列出branch
repo branch