blob: 4231a5321fcc79bee47f8427d29555ea8d4e42a4 [file] [log] [blame]
Shawn O. Pearcee31d02c2009-12-08 12:21:37 -08001Gerrit Code Review - Project Configuration
2==========================================
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08003
Shawn O. Pearce6e752212009-08-12 12:22:12 -07004Create Through SSH
5------------------
6
7Creating a new repository over SSH is perhaps the easiest way to
8configure a new project:
9
10====
11 ssh -p 29418 review.example.com gerrit create-project --name new/project
12====
13
14See link:cmd-create-project.html[gerrit create-project] for more
15details.
16
17
18Manual Creation
19---------------
20
Shawn O. Pearcec756ecf2011-06-20 18:49:57 -070021Projects may also be manually created.
Shawn O. Pearce6e752212009-08-12 12:22:12 -070022
Shawn O. Pearced2b73db2009-01-09 11:55:47 -080023Create Git Repository
Shawn O. Pearce6e752212009-08-12 12:22:12 -070024~~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearced2b73db2009-01-09 11:55:47 -080025
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -070026Create a Git repository under gerrit.basePath:
Shawn O. Pearced2b73db2009-01-09 11:55:47 -080027
28====
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -070029 git --git-dir=$base_path/new/project.git init
Shawn O. Pearced2b73db2009-01-09 11:55:47 -080030====
31
32[TIP]
Shawn O. Pearce55968232009-05-08 10:23:27 -070033By tradition the repository directory name should have a `.git`
34suffix.
Shawn O. Pearced2b73db2009-01-09 11:55:47 -080035
36To also make this repository available over the anonymous git://
Shawn O. Pearce55968232009-05-08 10:23:27 -070037protocol, don't forget to create a `git-daemon-export-ok` file:
Shawn O. Pearced2b73db2009-01-09 11:55:47 -080038
39====
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -070040 touch $base_path/new/project.git/git-daemon-export-ok
Shawn O. Pearced2b73db2009-01-09 11:55:47 -080041====
42
43Register Project
Shawn O. Pearce6e752212009-08-12 12:22:12 -070044~~~~~~~~~~~~~~~~
Shawn O. Pearced2b73db2009-01-09 11:55:47 -080045
Shawn O. Pearcec756ecf2011-06-20 18:49:57 -070046Either restart the server, or flush the `project_list` cache:
Shawn O. Pearced2b73db2009-01-09 11:55:47 -080047
48====
Shawn O. Pearcec756ecf2011-06-20 18:49:57 -070049 ssh -p 29418 localhost gerrit flush-caches --cache project_list
Shawn O. Pearced2b73db2009-01-09 11:55:47 -080050====
51
Shawn O. Pearce6e752212009-08-12 12:22:12 -070052[[submit_type]]
53Change Submit Action
54--------------------
Shawn O. Pearce97cd0ca2009-03-27 16:53:32 -070055
56The method Gerrit uses to submit a change to a project can be
57modified by any project owner through the project console, `Admin` >
58`Projects`. The following methods are supported:
59
60* Fast Forward Only
61+
62This method produces a strictly linear history. All merges must
63be handled on the client, prior to uploading to Gerrit for review.
64+
65To submit a change, the change must be a strict superset of the
66destination branch. That is, the change must already contain the
67tip of the destination branch at submit time.
68
69* Merge If Necessary
70+
Edwin Kempin31740d62011-10-12 09:27:51 +020071This is the default for a new project.
Shawn O. Pearce97cd0ca2009-03-27 16:53:32 -070072+
73If the change being submitted is a strict superset of the destination
74branch, then the branch is fast-forwarded to the change. If not,
75then a merge commit is automatically created. This is identical
Edwin Kempincdb0e002011-09-08 14:23:30 +020076to the classical `git merge` behavior, or `git merge --ff`.
Shawn O. Pearce97cd0ca2009-03-27 16:53:32 -070077
78* Always Merge
79+
80Always produce a merge commit, even if the change is a strict
81superset of the destination branch. This is identical to the
Edwin Kempincdb0e002011-09-08 14:23:30 +020082behavior of `git merge --no-ff`, and may be useful if the
83project needs to follow submits with `git log --first-parent`.
Shawn O. Pearce97cd0ca2009-03-27 16:53:32 -070084
Shawn O. Pearce3d17dbd2009-03-27 19:32:52 -070085* Cherry Pick
86+
87Always cherry pick the patch set, ignoring the parent lineage
88and instead creating a brand new commit on top of the current
89branch head.
90+
91When cherry picking a change, Gerrit automatically appends onto the
92end of the commit message a short summary of the change's approvals,
93and a URL link back to the change on the web. The committer header
94is also set to the submitter, while the author header retains the
95original patch set author.
Francois Marier8748e5e2011-04-12 16:00:37 +120096+
97Note that Gerrit ignores patch set dependencies when operating in
98cherry-pick mode. Submitters must remember to submit changes in
99the right order since inter-change dependencies will not be
100enforced for them.
Shawn O. Pearce3d17dbd2009-03-27 19:32:52 -0700101
Shawn O. Pearce97cd0ca2009-03-27 16:53:32 -0700102
Shawn O. Pearce18d37202009-02-17 17:03:23 -0800103Registering Additional Branches
104-------------------------------
Shawn O. Pearced2b73db2009-01-09 11:55:47 -0800105
Shawn O. Pearce18d37202009-02-17 17:03:23 -0800106Branches can be created over the SSH port by any `git push` client,
107if the user has been granted the `Push Branch` > `Create Branch`
108(or higher) access right.
Shawn O. Pearced2b73db2009-01-09 11:55:47 -0800109
Shawn O. Pearce18d37202009-02-17 17:03:23 -0800110Additional branches can also be created through the web UI, assuming
111at least one commit already exists in the project repository.
112A project owner can create additional branches under `Admin` >
113`Projects` > `Branches`. Enter the new branch name, and the
114starting Git revision. Branch names that don't start with `refs/`
115will automatically have `refs/heads/` prefixed to ensure they are
116a standard Git branch name. Almost any valid SHA-1 expression can
117be used to specify the starting revision, so long as it resolves
118to a commit object. Abbreviated SHA-1s are not supported.
Shawn O. Pearce5500e692009-05-28 15:55:01 -0700119
120GERRIT
121------
122Part of link:index.html[Gerrit Code Review]