debian-mirror-gitlab/doc/gitlab-basics/create-project.md

76 lines
3.1 KiB
Markdown
Raw Normal View History

2015-09-11 14:41:01 +05:30
# How to create a project in GitLab
2018-03-17 18:26:18 +05:30
>**Notes:**
- For a list of words that are not allowed to be used as project names see the
[reserved names][reserved].
2017-08-17 22:00:37 +05:30
1. In your dashboard, click the green **New project** button or use the plus
icon in the upper right corner of the navigation bar.
2015-09-11 14:41:01 +05:30
2016-11-03 12:29:30 +05:30
![Create a project](img/create_new_project_button.png)
2015-09-11 14:41:01 +05:30
2017-08-17 22:00:37 +05:30
1. This opens the **New project** page.
2015-09-11 14:41:01 +05:30
2016-11-03 12:29:30 +05:30
![Project information](img/create_new_project_info.png)
2015-09-11 14:41:01 +05:30
2017-09-10 17:25:29 +05:30
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
2018-03-17 18:26:18 +05:30
clicking on the **Import project** tab, provided this is enabled in
2017-09-10 17:25:29 +05:30
your GitLab instance. Ask your administrator if not.
2017-08-17 22:00:37 +05:30
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.
2018-11-08 19:23:39 +05:30
- 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.
2017-08-17 22:00:37 +05:30
1. Click **Create project**.
2018-03-17 18:26:18 +05:30
## 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
GitLab to create the new project, all without leaving your terminal. If you have access to that
2018-11-18 11:00:15 +05:30
namespace, we will automatically create a new project under that GitLab namespace with its
2018-03-27 19:54:05 +05:30
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)).
2018-03-17 18:26:18 +05:30
This can be done by using either SSH or HTTP:
```
## Git push using SSH
2018-03-27 19:54:05 +05:30
git push --set-upstream git@gitlab.example.com:namespace/nonexistent-project.git master
2018-03-17 18:26:18 +05:30
## Git push using HTTP
2018-03-27 19:54:05 +05:30
git push --set-upstream https://gitlab.example.com/namespace/nonexistent-project.git master
2018-03-17 18:26:18 +05:30
```
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:
remote: git remote add origin https://gitlab.example.com/namespace/nonexistent-project.git
remote:
remote: To view the project, visit:
remote: https://gitlab.example.com/namespace/nonexistent-project
remote:
```
2017-08-17 22:00:37 +05:30
[import it]: ../workflow/importing/README.md
2018-03-17 18:26:18 +05:30
[reserved]: ../user/reserved_names.md