Fork me on GitHub

Git for Gerrit 客户端配置指导

Install and config Git
install git
1
$sudo apt-get install git
config git
1
$git config --global user.name "Your Name"
1
$git config --global user.email "your.email@gmail.com"

Note:”Your Name” must be same with your domain name, for example wei.cheng

Check config information
1
$git config --list
Generate and upload ssh key

On Linux

1
$ssh-keygen -t rsa -C "your.email@gmail.com"

Don’t use any passphrase

1
$vim ~/.ssh/config
1
2
3
4
5
6
----------------------------------------------------------------

Host *
KexAlgorithms +diffie-hellman-group1-sha1

----------------------------------------------------------------
1
$cat ~/.ssh/id_rsa.pub

Copy the whole file into clipboard
Open gerrit website , On website, goto “Settings -> SSH Public Keys”, paste the key, press “Add”

Clone projects
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$git clone <ssh://your.name@gerrit.ai.bmfusion.net:29418/xxx.git>
$git submodule init
$git submodule update --rebase --remote

$git fetch origin

$git rebase origin/master

#Do merge if needed, after solving conflict, run
$git rebase --continue

#Amend the previous change if needed
$git commit --amend

#Push
$git push origin HEAD:refs/for/master
您的鼓励是我持之以恒的动力