ubuntu는git/repo로gerrit 코드 앞의 로컬 기본 설정을 가져옵니다
1. Create you SSH-key.
If you've already generated it, you don't need to regenerate it ! else:$ssh-keygen -t rsa -C your-email Now the public key will be located in ~/.ssh/id_rsa.pub
2. Add your key to Gerrit server.
$cat ~/.ssh/id_rsa.pub • Open web of gerrit , sign in • Click “Settings” and then “SSH Public keys”. Paste the entire contents of your ~/.ssh/id_rsa.pub into the textbox and click the “add” button.
3. Create or edit the file ~/.ssh/config and add configuration.
$sudo apt-get install vim (you need know a little VIM, if not, please use gedit)$vi ~/.ssh/config or gedit ~/.ssh/config Paste and edit the following content:
Host gerrit1
HostName XXXXX
Port 29418
User your-gerrit-login-username
IdentityFile ~/.ssh/id_rsa
$chmod og-rwx ~/.ssh/config
4. Config Git
$sudo apt-get install git $git config --global user.email “your-gerrit-email” $git config --global user.name “your-gerrit-login-username” $vi ~/.gitconfig Paste and edit the following content:
[review "http://XXXXX:8080"]
username = your-gerrit-login-username
5. Now to verify your ssh setup is okay and key is working correctly, try to connect to Gerrit’s SSH port:
$ssh gerrit1 If the following information appears, the configuration is successful: **** Welcome to Gerrit Code Review ****
6. Install repo
$mkdir ~/bin
get the repo from your team, and copy repo to ~/bin/
$vi ~/bin/repo
edit the REPO_URL and REPO_REV for your repo for example
REPO_URL = 'ssh://XXXX/repo'
REPO_REV = 'stable'
$chmod +x ~/bin/repo $ sudo vi ~/.bashrc Add a new line at the end:
export PATH=$PATH:~/bin
$source ~/.bashrc
PS:
If you want to get the repo for yourself:
$git clone https://code.csdn.net/kangear/git-repo.git -b stable
$cp git-repo/repo ~/bin
7. Verify repo
$repo help If the following information appears, the configuration is successful: cmd : help usage: repo COMMAND [ARGS] repo is not yet installed. Use "repo init"to install it here. The most commonly used repo commands are: init Install repo in the current working directory help Display detailed help on a command For access to the full online help, install repo ("repo init").
8. Then, you can request the access permission and try to sync the code.
You can use 'git clone XXX' or 'repo init -u XX -m XX -b XX' to sync code.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
다양한 언어의 JSONJSON은 Javascript 표기법을 사용하여 데이터 구조를 레이아웃하는 데이터 형식입니다. 그러나 Javascript가 코드에서 이러한 구조를 나타낼 수 있는 유일한 언어는 아닙니다. 저는 일반적으로 '객체'{}...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.