In general, cloning a project after Local:
Initial setupFirst, get the public Keys1. Enter your virtual machine, enter "ssh-keygen-t RSA" at the command line, go all the way, 2. Enter "Cat ~/.ssh/id_rsa.pub", copy two, activate Gerrit account, add SSH public Keys 1. Open http://10.120.10.101/Login (account: Mailbox prefix initial password: 123456) First login will prompt to register the mailbox, add SSH pulick Key, if you miss this step, please follow the steps below to add: 2. Select the " Settings "3. Select" Contact information ", Register New email, fill in your email address,CopyEmail the full link address to the browser to activate your account. 4. Click "SSH public Keys" in Gerrit's "Settings" interface, paste the keys from the above into the edit box, click "Add" to download the code (italics please fill in according to the actual project) git clone ssh://yourname@10.120.10.101:29418/XXX-BBranchname Workspace(If there is a problem with permission denied (PublicKey) after you add SSH public keys, try executing the command "Ssh-add") Iv. Enter the working directory configuration CD workspacegit config User.Name "Your name" (Gerrit login) git config user.email "[email protected]" (Gerrit registered email address) Curl HTTP://10.120.10.101: 9999/tools/hooks/commit-msg > Git/hooks/commit-msgchmod +x. git/hooks/commit-msg
The development process establishes a private branch that works on a private branch: Git checkout-b private_branch
uploading code to the server 1. Update code base: Git fetch2. Merging new code into private branch: Git rebase remotes/origin/branchname3. Resolving conflicts 4. Push to Server, pending review: Git push Origin head:refs/for/ Branchname5. Direct Push Branch to server (requires permission to push branch, typically only project owner action): Git push Origin Branchname
review do not pass, modify the submission 1. Modify Code 2.git Add Xxx3.git commit--amend4.git push Origin Head:refs/for/branchname
Git+gerrit User Guide