blob: 36d3c60b0cae2ea1fa29f7749398e5389ab2d4cf [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
Edwin Kempin5819c952012-12-12 13:07:05 +010057modified by any project owner through the project console, `Projects` >
58`List` > my/project. The following methods are supported:
Shawn O. Pearce97cd0ca2009-03-27 16:53:32 -070059
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
Edwin Kempin39462122013-03-27 09:18:19 +0100102[[rebase_if_necessary]]
Edwin Kempin00aa4f02012-09-12 13:38:44 +0200103* Rebase If Necessary
104+
105If the change being submitted is a strict superset of the destination
106branch, then the branch is fast-forwarded to the change. If not,
107then the change is automatically rebased and then the branch is
108fast-forwarded to the change.
109
Edwin Kempin37118e72011-10-12 10:04:47 +0200110When Gerrit tries to do a merge, by default the merge will only
David Pursehouse17c051d2013-05-14 17:45:00 +0900111succeed if there is no path conflict. A path conflict occurs when
112the same file has also been changed on the other side of the merge.
113
114If `Automatically resolve conflicts` is enabled, Gerrit will try
115to do a content merge when a path conflict occurs.
Edwin Kempin37118e72011-10-12 10:04:47 +0200116
Shawn O. Pearce97cd0ca2009-03-27 16:53:32 -0700117
Shawn O. Pearce18d37202009-02-17 17:03:23 -0800118Registering Additional Branches
119-------------------------------
Shawn O. Pearced2b73db2009-01-09 11:55:47 -0800120
Shawn O. Pearce18d37202009-02-17 17:03:23 -0800121Branches can be created over the SSH port by any `git push` client,
Fredrik Luthander5aa7b592011-12-08 16:45:32 +0100122if the user has been granted the `Create Reference` access right.
Shawn O. Pearced2b73db2009-01-09 11:55:47 -0800123
Shawn O. Pearce18d37202009-02-17 17:03:23 -0800124Additional branches can also be created through the web UI, assuming
125at least one commit already exists in the project repository.
Edwin Kempin5819c952012-12-12 13:07:05 +0100126A project owner can create additional branches under `Projects` >
127`List` > my/project > `Branches`. Enter the new branch name, and the
Shawn O. Pearce18d37202009-02-17 17:03:23 -0800128starting Git revision. Branch names that don't start with `refs/`
129will automatically have `refs/heads/` prefixed to ensure they are
130a standard Git branch name. Almost any valid SHA-1 expression can
131be used to specify the starting revision, so long as it resolves
132to a commit object. Abbreviated SHA-1s are not supported.
Shawn O. Pearce5500e692009-05-28 15:55:01 -0700133
134GERRIT
135------
136Part of link:index.html[Gerrit Code Review]