blob: 84013adada2d4f22e7de38b7681010ed6c1a6131 [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> \
13[\--owner <OWNER>] \
14[\--description <DESC>] \
15[\--submit-type <TYPE>] \
16[\--use-contributor-agreements {true|false}] \
17[\--use-signed-off-by {true|false}]
18
19DESCRIPTION
20-----------
21Creates a new bare Git repository under `gerrit.basePath`, using
22the project name supplied. The newly created repository is empty
23(has no commits), but is registered in the Gerrit database so that
24the initial commit may be uploaded for review, or initial content
25can be pushed directly into a branch.
26
27If replication is enabled, this command also connects to each of
28the configured remote systems over SSH and uses command line git
29on the remote system to create the empty repository.
30
31
32ACCESS
33------
34Caller must be a member of the privileged 'Administrators' group.
35
36SCRIPTING
37---------
38This command is intended to be used in scripts.
39
40OPTIONS
41-------
42\--name::
43Required; name of the project to create. If name ends with
44`.git` the suffix will be automatically removed.
45
46\--owner::
47Name of the group which will initially own this repository.
48The specified group must already be defined within Gerrit.
49Only one group can be specified on the command line.
50To specify additional owners, add the additional owners
51through the web interface after project creation.
52+
53Defaults to `Administrators` if not specified.
54
55\--description::
56Initial description of the project. If not specified,
57no description is stored.
58
59\--submit-type::
60Action used by Gerrit to submit an approved change to its
61destination branch. Supported options are:
62+
63* fast-forward-only: produces a strictly linear history.
64* merge-if-necessary: create a merge commit when required.
65* merge-always: always create a merge commit.
66* cherry-pick: always cherry-pick the commit.
67
68+
69Defaults to fast-forward-only. For more details see
70link:project-setup.html#submit_type[Change Submit Actions].
71
72\--use-contributor-agreements::
73If enabled, authors must complete a contributor agreement
74on the site before pushing any commits or changes to this
75project. Disabled by default.
76
77\--use-signed-off-by::
78If enabled, each change must contain a Signed-off-by line
79from either the author or the uploader in the commit message.
80Disabled by default.
81
82
83EXAMPLES
84--------
85Create a new project called `tools/gerrit`:
86
87====
88$ ssh -p 29418 review.example.com gerrit create-project --name tools/gerrit.git
89====
90
91REPLICATION
92-----------
93The remote repository creation is performed by a Bourne shell script:
94
95====
96 mkdir -p '/base/project.git' && cd '/base/project.git' && git init --bare
97====
98
99For this to work successfully the remote system must be able to
100run arbitrary shell scripts, and must have `git` in the user's PATH
101environment variable. Administrators can run this command by hand
102to establish a new empty repository if necessary.
103
104SEE ALSO
105--------
106
107* link:config-replication.html[Git Replication/Mirroring]
108* link:project-setup.html[Project Setup]
109
110GERRIT
111------
112Part of link:index.html[Gerrit Code Review]