Shawn O. Pearce | e31d02c | 2009-12-08 12:21:37 -0800 | [diff] [blame] | 1 | Gerrit Code Review - Project Configuration |
| 2 | ========================================== |
Shawn O. Pearce | d2b73db | 2009-01-09 11:55:47 -0800 | [diff] [blame] | 3 | |
Shawn O. Pearce | 6e75221 | 2009-08-12 12:22:12 -0700 | [diff] [blame] | 4 | Create Through SSH |
| 5 | ------------------ |
| 6 | |
| 7 | Creating a new repository over SSH is perhaps the easiest way to |
| 8 | configure a new project: |
| 9 | |
| 10 | ==== |
| 11 | ssh -p 29418 review.example.com gerrit create-project --name new/project |
| 12 | ==== |
| 13 | |
| 14 | See link:cmd-create-project.html[gerrit create-project] for more |
| 15 | details. |
| 16 | |
| 17 | |
| 18 | Manual Creation |
| 19 | --------------- |
| 20 | |
Shawn O. Pearce | c756ecf | 2011-06-20 18:49:57 -0700 | [diff] [blame] | 21 | Projects may also be manually created. |
Shawn O. Pearce | 6e75221 | 2009-08-12 12:22:12 -0700 | [diff] [blame] | 22 | |
Shawn O. Pearce | d2b73db | 2009-01-09 11:55:47 -0800 | [diff] [blame] | 23 | Create Git Repository |
Shawn O. Pearce | 6e75221 | 2009-08-12 12:22:12 -0700 | [diff] [blame] | 24 | ~~~~~~~~~~~~~~~~~~~~~ |
Shawn O. Pearce | d2b73db | 2009-01-09 11:55:47 -0800 | [diff] [blame] | 25 | |
Shawn O. Pearce | 9743d0b | 2009-06-01 10:10:06 -0700 | [diff] [blame] | 26 | Create a Git repository under gerrit.basePath: |
Shawn O. Pearce | d2b73db | 2009-01-09 11:55:47 -0800 | [diff] [blame] | 27 | |
| 28 | ==== |
Shawn O. Pearce | 9743d0b | 2009-06-01 10:10:06 -0700 | [diff] [blame] | 29 | git --git-dir=$base_path/new/project.git init |
Shawn O. Pearce | d2b73db | 2009-01-09 11:55:47 -0800 | [diff] [blame] | 30 | ==== |
| 31 | |
| 32 | [TIP] |
Shawn O. Pearce | 5596823 | 2009-05-08 10:23:27 -0700 | [diff] [blame] | 33 | By tradition the repository directory name should have a `.git` |
| 34 | suffix. |
Shawn O. Pearce | d2b73db | 2009-01-09 11:55:47 -0800 | [diff] [blame] | 35 | |
| 36 | To also make this repository available over the anonymous git:// |
Shawn O. Pearce | 5596823 | 2009-05-08 10:23:27 -0700 | [diff] [blame] | 37 | protocol, don't forget to create a `git-daemon-export-ok` file: |
Shawn O. Pearce | d2b73db | 2009-01-09 11:55:47 -0800 | [diff] [blame] | 38 | |
| 39 | ==== |
Shawn O. Pearce | 9743d0b | 2009-06-01 10:10:06 -0700 | [diff] [blame] | 40 | touch $base_path/new/project.git/git-daemon-export-ok |
Shawn O. Pearce | d2b73db | 2009-01-09 11:55:47 -0800 | [diff] [blame] | 41 | ==== |
| 42 | |
| 43 | Register Project |
Shawn O. Pearce | 6e75221 | 2009-08-12 12:22:12 -0700 | [diff] [blame] | 44 | ~~~~~~~~~~~~~~~~ |
Shawn O. Pearce | d2b73db | 2009-01-09 11:55:47 -0800 | [diff] [blame] | 45 | |
Shawn O. Pearce | c756ecf | 2011-06-20 18:49:57 -0700 | [diff] [blame] | 46 | Either restart the server, or flush the `project_list` cache: |
Shawn O. Pearce | d2b73db | 2009-01-09 11:55:47 -0800 | [diff] [blame] | 47 | |
| 48 | ==== |
Shawn O. Pearce | c756ecf | 2011-06-20 18:49:57 -0700 | [diff] [blame] | 49 | ssh -p 29418 localhost gerrit flush-caches --cache project_list |
Shawn O. Pearce | d2b73db | 2009-01-09 11:55:47 -0800 | [diff] [blame] | 50 | ==== |
| 51 | |
Shawn O. Pearce | 6e75221 | 2009-08-12 12:22:12 -0700 | [diff] [blame] | 52 | [[submit_type]] |
| 53 | Change Submit Action |
| 54 | -------------------- |
Shawn O. Pearce | 97cd0ca | 2009-03-27 16:53:32 -0700 | [diff] [blame] | 55 | |
| 56 | The method Gerrit uses to submit a change to a project can be |
| 57 | modified by any project owner through the project console, `Admin` > |
| 58 | `Projects`. The following methods are supported: |
| 59 | |
| 60 | * Fast Forward Only |
| 61 | + |
| 62 | This method produces a strictly linear history. All merges must |
| 63 | be handled on the client, prior to uploading to Gerrit for review. |
| 64 | + |
| 65 | To submit a change, the change must be a strict superset of the |
| 66 | destination branch. That is, the change must already contain the |
| 67 | tip of the destination branch at submit time. |
| 68 | |
| 69 | * Merge If Necessary |
| 70 | + |
Edwin Kempin | 31740d6 | 2011-10-12 09:27:51 +0200 | [diff] [blame^] | 71 | This is the default for a new project. |
Shawn O. Pearce | 97cd0ca | 2009-03-27 16:53:32 -0700 | [diff] [blame] | 72 | + |
| 73 | If the change being submitted is a strict superset of the destination |
| 74 | branch, then the branch is fast-forwarded to the change. If not, |
| 75 | then a merge commit is automatically created. This is identical |
Edwin Kempin | cdb0e00 | 2011-09-08 14:23:30 +0200 | [diff] [blame] | 76 | to the classical `git merge` behavior, or `git merge --ff`. |
Shawn O. Pearce | 97cd0ca | 2009-03-27 16:53:32 -0700 | [diff] [blame] | 77 | |
| 78 | * Always Merge |
| 79 | + |
| 80 | Always produce a merge commit, even if the change is a strict |
| 81 | superset of the destination branch. This is identical to the |
Edwin Kempin | cdb0e00 | 2011-09-08 14:23:30 +0200 | [diff] [blame] | 82 | behavior of `git merge --no-ff`, and may be useful if the |
| 83 | project needs to follow submits with `git log --first-parent`. |
Shawn O. Pearce | 97cd0ca | 2009-03-27 16:53:32 -0700 | [diff] [blame] | 84 | |
Shawn O. Pearce | 3d17dbd | 2009-03-27 19:32:52 -0700 | [diff] [blame] | 85 | * Cherry Pick |
| 86 | + |
| 87 | Always cherry pick the patch set, ignoring the parent lineage |
| 88 | and instead creating a brand new commit on top of the current |
| 89 | branch head. |
| 90 | + |
| 91 | When cherry picking a change, Gerrit automatically appends onto the |
| 92 | end of the commit message a short summary of the change's approvals, |
| 93 | and a URL link back to the change on the web. The committer header |
| 94 | is also set to the submitter, while the author header retains the |
| 95 | original patch set author. |
Francois Marier | 8748e5e | 2011-04-12 16:00:37 +1200 | [diff] [blame] | 96 | + |
| 97 | Note that Gerrit ignores patch set dependencies when operating in |
| 98 | cherry-pick mode. Submitters must remember to submit changes in |
| 99 | the right order since inter-change dependencies will not be |
| 100 | enforced for them. |
Shawn O. Pearce | 3d17dbd | 2009-03-27 19:32:52 -0700 | [diff] [blame] | 101 | |
Shawn O. Pearce | 97cd0ca | 2009-03-27 16:53:32 -0700 | [diff] [blame] | 102 | |
Shawn O. Pearce | 18d3720 | 2009-02-17 17:03:23 -0800 | [diff] [blame] | 103 | Registering Additional Branches |
| 104 | ------------------------------- |
Shawn O. Pearce | d2b73db | 2009-01-09 11:55:47 -0800 | [diff] [blame] | 105 | |
Shawn O. Pearce | 18d3720 | 2009-02-17 17:03:23 -0800 | [diff] [blame] | 106 | Branches can be created over the SSH port by any `git push` client, |
| 107 | if the user has been granted the `Push Branch` > `Create Branch` |
| 108 | (or higher) access right. |
Shawn O. Pearce | d2b73db | 2009-01-09 11:55:47 -0800 | [diff] [blame] | 109 | |
Shawn O. Pearce | 18d3720 | 2009-02-17 17:03:23 -0800 | [diff] [blame] | 110 | Additional branches can also be created through the web UI, assuming |
| 111 | at least one commit already exists in the project repository. |
| 112 | A project owner can create additional branches under `Admin` > |
| 113 | `Projects` > `Branches`. Enter the new branch name, and the |
| 114 | starting Git revision. Branch names that don't start with `refs/` |
| 115 | will automatically have `refs/heads/` prefixed to ensure they are |
| 116 | a standard Git branch name. Almost any valid SHA-1 expression can |
| 117 | be used to specify the starting revision, so long as it resolves |
| 118 | to a commit object. Abbreviated SHA-1s are not supported. |
Shawn O. Pearce | 5500e69 | 2009-05-28 15:55:01 -0700 | [diff] [blame] | 119 | |
| 120 | GERRIT |
| 121 | ------ |
| 122 | Part of link:index.html[Gerrit Code Review] |