GitLab steht wegen Wartungsarbeiten am Montag, den 10. Mai, zwischen 17:00 und 19:00 Uhr nicht zur Verfügung.

create-project.md 4.17 KB
Newer Older
1 2
# How to create a project in GitLab

Bob Van Landuyt's avatar
Bob Van Landuyt committed
3 4 5 6
>**Notes:**
- For a list of words that are not allowed to be used as project names see the
  [reserved names][reserved].

7 8
1. In your dashboard, click the green **New project** button or use the plus
   icon in the upper right corner of the navigation bar.
9

10
    ![Create a project](img/create_new_project_button.png)
11

12
1. This opens the **New project** page.
13

14
    ![Project information](img/create_new_project_info.png)
15

16 17 18 19
1. Choose if you want start a blank project, or with one of the predefined
   [Project Templates](https://gitlab.com/gitlab-org/project-templates):
   this will kickstart your repository code and CI automatically.
   Otherwise, if you have a project in a different repository, you can [import it] by
20
   clicking on the **Import project** tab, provided this is enabled in
21 22
   your GitLab instance. Ask your administrator if not.

23 24 25 26 27 28 29 30 31 32
1. Provide the following information:
    - Enter the name of your project in the **Project name** field. You can't use
      special characters, but you can use spaces, hyphens, underscores or even
      emoji.
    - The **Project description (optional)** field enables you to enter a
      description for your project's dashboard, which will help others
      understand what your project is about. Though it's not required, it's a good
      idea to fill this in.
    - Changing the **Visibility Level** modifies the project's
      [viewing and access rights](../public_access/public_access.md) for users.
33 34 35
    - Selecting the **Initialize repository with a README** option creates a
      README so that the Git repository is initialized, has a default branch and
      can be cloned.
36 37 38

1. Click **Create project**.

39 40 41 42 43
## Custom project templates
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ee/issues/6860) in [GitLab Edition Premium][ee] 11.2

When you create a new project, creating it based on custom project templates is a convenient option to bootstrap from an existing project boilerplate. The administration setting to configure a GitLab group that serves as template source can be found under **Admin > Settings > Custom project templates**.

Francisco Javier López's avatar
Francisco Javier López committed
44 45 46 47
Within this section, you can configure the group where all the custom project templates are sourced. Every project direcly under the group namespace will be available to the user if they have access to them. For example: Every public project in the group will be available to the user. However, private projects will be available only if the user is authorized.  
Projects below subgroups of the template group are not supported.

Repository and database information that are copied over to your template instance are identical to our GitLab project export. See the [Project import/export documentation](../user/project/settings/import_export.md) for reference.
48

49 50 51 52 53 54
## Push to create a new project

> [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/issues/26388) in GitLab 10.5.

When you create a new repo locally, instead of going to GitLab to manually
create a new project and then push the repo, you can directly push it to
55
GitLab to create the new project, all without leaving your terminal. If you have access to that
56
namespace, we will automatically create a new project under that GitLab namespace with its
57
visibility set to Private by default (you can later change it in the [project's settings](../public_access/public_access.md#how-to-change-project-visibility)).
58 59 60 61 62

This can be done by using either SSH or HTTP:

```
## Git push using SSH
63
git push --set-upstream git@gitlab.example.com:namespace/nonexistent-project.git master
64 65

## Git push using HTTP
66
git push --set-upstream https://gitlab.example.com/namespace/nonexistent-project.git master
67 68 69 70 71 72 73 74 75 76
```

Once the push finishes successfully, a remote message will indicate
the command to set the remote and the URL to the new project:

```
remote:
remote: The private project namespace/nonexistent-project was created.
remote:
remote: To configure the remote, run:
77
remote:   git remote add origin https://gitlab.example.com/namespace/nonexistent-project.git
78 79
remote:
remote: To view the project, visit:
80
remote:   https://gitlab.example.com/namespace/nonexistent-project
81 82 83
remote:
```

84
[import it]: ../workflow/importing/README.md
Bob Van Landuyt's avatar
Bob Van Landuyt committed
85
[reserved]:  ../user/reserved_names.md