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