Làm việc với Gerrit
Account setup
Gerrit server: https://review.jami.net
Tài liệu người dùng: https://review.jami.net/Documentation/intro-user.html
Các dự án Jami trên Gerrit: https://review.jami.net/admin/repos/
Sign in with your Google, GitHub, or git.jami.net account.
Bạn cũng cần phải [upload một khóa SSH]https://review.jami.net/settings/#SSHKeys) để có thể thực hiện thay đổi để xem xét.
Đừng quên chọn tên người dùng.
Finally, the email address specified in your git config must match one of the email addresses registered with your Gerrit account.
Quan trọng
For Savoir-faire Linux Inc. employees: please continue to use your @savoirfairelinux.com email address.
To view your Git config
git config --list
To test your SSH access
To check that your SSH access is properly set up, run the following command:
ssh -p 29420 <username>@review.jami.net
If your access is granted, you should see a message like:
**** Welcome to Gerrit Code Review ****
Hi, you have successfully connected over SSH.
Unfortunately, interactive shells are disabled.
To clone a hosted Git repository, use:
git clone ssh://<username>@review.jami.net:29420/REPOSITORY_NAME.git
Connection to review.jami.net closed.
Git configuration
Gerrit is the official Git repository.
Để cập nhật cấu hình
You must update your remote information to now use the Gerrit repository. To do that, update your origin URL:
git từ xa đặt url nguồn gốc ssh://<username>@review.jami.net:29420/<project_name>
Replace <project_name>
with the correct project (example: jami-daemon).
Hoặc sao chép kho lưu trữ hiện có nếu bạn muốn bắt đầu từ đầu.
To Push by Default in ref/for/master
You can configure Git to automatically create a review when a change is pushed.
git config remote.origin.push HEAD:refs/for/master
Để tạo ra bài xem xét
Khi đẩy sang chi nhánh ma thuật này, một đánh giá sẽ tự động được tạo ra về Gerrit.
git đẩy nguồn gốc HEAD:refs/for/master
Nếu bạn đã cấu hình mặc định để refs/for/master như đã mô tả ở trên, chỉ cần
git đẩy
Nếu HEAD hiện đang chỉ ra chi nhánh với các commit bạn muốn đẩy. lý tưởng nhất, bạn nên làm việc trong một feature / bug branch cho vấn đề đang xảy ra.
git nguồn gốc <bugfix_branchname>:refs/for/master
If this is the first time you've pushed, you will be prompted to install a post-commit hook to insert a Change-ID in your commit message. Gerrit needs this to track patch sets and will reject pushes until you install it. Simply copy and paste the command to install the hook as instructed by Gerrit and amend your commits.
To push a private patch
You can push a work in progress (a.k.a. draft) by pushing to refs/for/master%private
.
Ví dụ, bạn có thể muốn một bộ điều khiển từ xa "tự do" để nhấn vào; mở <project_dir>/.git/config và thêm:
[remote "private"]
url = ssh://<username>@review.jami.net:29420/jami-daemon
push = HEAD:refs/for/master%private
Sau đó:
git đẩy riêng
Công việc riêng cũng giống như các bộ vá, ngoại trừ chúng không hiển thị cho người khác theo mặc định và không kích hoạt bất kỳ cấu trúc nào của Jenkins.