blob: d1e08b1d446de1d7972e6e78abb364df4afc8b69 [file] [log] [blame]
Shawn O. Pearce6e752212009-08-12 12:22:12 -07001gerrit create-project
2=====================
3
4NAME
5----
6gerrit create-project - Create a new hosted project
7
8SYNOPSIS
9--------
10[verse]
11'ssh' -p <port> <host> 'gerrit create-project' \
12\--name <NAME> \
Shawn O. Pearce8c56a8c2009-09-18 19:21:08 -070013[--branch <REF>] \
14[\--owner <GROUP>] \
Shawn O. Pearce6e752212009-08-12 12:22:12 -070015[\--description <DESC>] \
16[\--submit-type <TYPE>] \
Shawn O. Pearce8c56a8c2009-09-18 19:21:08 -070017[\--use-contributor-agreements] \
18[\--use-signed-off-by]
Shawn O. Pearce6e752212009-08-12 12:22:12 -070019
20DESCRIPTION
21-----------
22Creates a new bare Git repository under `gerrit.basePath`, using
23the project name supplied. The newly created repository is empty
24(has no commits), but is registered in the Gerrit database so that
25the initial commit may be uploaded for review, or initial content
26can be pushed directly into a branch.
27
28If replication is enabled, this command also connects to each of
29the configured remote systems over SSH and uses command line git
30on the remote system to create the empty repository.
31
32
33ACCESS
34------
35Caller must be a member of the privileged 'Administrators' group.
36
37SCRIPTING
38---------
39This command is intended to be used in scripts.
40
41OPTIONS
42-------
43\--name::
44Required; name of the project to create. If name ends with
45`.git` the suffix will be automatically removed.
46
Shawn O. Pearce8c56a8c2009-09-18 19:21:08 -070047\--branch::
48Name of the initial branch in the newly created project.
49Defaults to 'master'.
50
Shawn O. Pearce6e752212009-08-12 12:22:12 -070051\--owner::
52Name of the group which will initially own this repository.
53The specified group must already be defined within Gerrit.
54Only one group can be specified on the command line.
55To specify additional owners, add the additional owners
56through the web interface after project creation.
57+
58Defaults to `Administrators` if not specified.
59
60\--description::
61Initial description of the project. If not specified,
62no description is stored.
Shawn O. Pearceea6fc172009-09-18 15:40:38 -070063+
64Description values containing spaces should be quoted in single quotes
65(\'). This most likely requires double quoting the value, for example
66`\--description "\'A description string\'"`.
Shawn O. Pearce6e752212009-08-12 12:22:12 -070067
68\--submit-type::
69Action used by Gerrit to submit an approved change to its
70destination branch. Supported options are:
71+
Shawn O. Pearce8c56a8c2009-09-18 19:21:08 -070072* FAST_FORWARD_ONLY: produces a strictly linear history.
73* MERGE_IF_NECESSARY: create a merge commit when required.
74* MERGE_ALWAYS: always create a merge commit.
75* CHERRY_PICK: always cherry-pick the commit.
Shawn O. Pearce6e752212009-08-12 12:22:12 -070076
77+
Shawn O. Pearce8c56a8c2009-09-18 19:21:08 -070078Defaults to MERGE_IF_NECESSARY. For more details see
Shawn O. Pearce6e752212009-08-12 12:22:12 -070079link:project-setup.html#submit_type[Change Submit Actions].
80
81\--use-contributor-agreements::
82If enabled, authors must complete a contributor agreement
83on the site before pushing any commits or changes to this
84project. Disabled by default.
85
86\--use-signed-off-by::
87If enabled, each change must contain a Signed-off-by line
88from either the author or the uploader in the commit message.
89Disabled by default.
90
91
92EXAMPLES
93--------
94Create a new project called `tools/gerrit`:
95
96====
97$ ssh -p 29418 review.example.com gerrit create-project --name tools/gerrit.git
98====
99
Shawn O. Pearceea6fc172009-09-18 15:40:38 -0700100Create a new project with a description:
101
102====
103$ ssh -p 29418 review.example.com gerrit create-project --name tool.git --description "'Tools used by build system'"
104====
105
106Note that it is necessary to quote the description twice. The local
107shell needs double quotes around the value to ensure the single quotes
108are passed through SSH as-is to the remote Gerrit server, which uses
109the single quotes to delimit the value.
110
Shawn O. Pearce6e752212009-08-12 12:22:12 -0700111REPLICATION
112-----------
113The remote repository creation is performed by a Bourne shell script:
114
115====
Shawn O. Pearce8c56a8c2009-09-18 19:21:08 -0700116 mkdir -p '/base/project.git' && cd '/base/project.git' && git init --bare && git update-ref HEAD refs/heads/master
Shawn O. Pearce6e752212009-08-12 12:22:12 -0700117====
118
Shawn O. Pearce8c56a8c2009-09-18 19:21:08 -0700119For this to work successfully the remote system must be able to run
120arbitrary shell scripts, and must have `git` in the user's PATH
121environment variable. Administrators could also run this command line
122by hand to establish a new empty repository.
Shawn O. Pearce6e752212009-08-12 12:22:12 -0700123
124SEE ALSO
125--------
126
127* link:config-replication.html[Git Replication/Mirroring]
128* link:project-setup.html[Project Setup]
129
130GERRIT
131------
132Part of link:index.html[Gerrit Code Review]