Commit 2af7d0af authored by Igor Drozdov's avatar Igor Drozdov

Merge branch '322882-aqualls-push-improvements' into 'master'

Revise push-locally instructions

See merge request gitlab-org/gitlab!59432
parents c12d1090 d477f0c7
...@@ -148,39 +148,44 @@ To use a custom project template on the **New project** page: ...@@ -148,39 +148,44 @@ To use a custom project template on the **New project** page:
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/26388) in GitLab 10.5. > [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/26388) in GitLab 10.5.
When you create a new repository locally, instead of manually creating a new project in GitLab When you create a new repository locally, you don't have to sign in to the GitLab
and then [cloning the repository](../../gitlab-basics/start-using-git.md#clone-a-repository) interface to create a project and
locally, you can directly push it to GitLab to create the new project, all without leaving [clone its repository](../../gitlab-basics/start-using-git.md#clone-a-repository).
your terminal. If you have access rights to the associated namespace, GitLab You can directly push your new repository to GitLab, which creates your new project
automatically creates a new project under that GitLab namespace with its visibility without leaving your terminal.
set to Private by default (you can later change it in the [project's settings](../../public_access/public_access.md#change-project-visibility)).
To push a new project:
This can be done by using either SSH or HTTPS:
1. Identify the [namespace](../group/index.md#namespaces) you want to add the new
```shell project to, as you need this information in a future step. To determine if you have
## Git push using SSH permission to create new projects in a namespace, view the group's page in a
git push --set-upstream git@gitlab.example.com:namespace/nonexistent-project.git master web browser and confirm the page displays a **New project** button.
## Git push using HTTPS NOTE:
git push --set-upstream https://gitlab.example.com/namespace/nonexistent-project.git master As project creation permissions can have many factors, contact your
``` GitLab administrator if you're unsure.
You can pass the flag `--tags` to the `git push` command to export existing repository tags. 1. If you want to push using SSH, ensure you have [created a SSH key](../../ssh/README.md) and
[added it to your GitLab account](../../ssh/index.md#add-an-ssh-key-to-your-gitlab-account).
Once the push finishes successfully, a remote message indicates 1. Push with one of the following methods. Replace `gitlab.example.com` with the
the command to set the remote and the URL to the new project: domain name of the machine that hosts your Git repository, `namespace` with the name of
your namespace, and `myproject` with the name of your new project:
```plaintext - To push with SSH: `git push --set-upstream git@gitlab.example.com:namespace/myproject.git master`
remote: - To push with HTTPS: `git push --set-upstream https://gitlab.example.com/namespace/myproject.git master`
remote: The private project namespace/nonexistent-project was created. Optional: to export existing repository tags, append the `--tags` flag to your `git push` command.
remote: 1. When the push completes, GitLab displays a message:
remote: To configure the remote, run:
remote: git remote add origin https://gitlab.example.com/namespace/nonexistent-project.git ```plaintext
remote: remote: The private project namespace/myproject was created.
remote: To view the project, visit: ```
remote: https://gitlab.example.com/namespace/nonexistent-project
remote: 1. (Optional) To configure the remote, alter the command
``` `git remote add origin https://gitlab.example.com/namespace/myproject.git`
to match your namespace and project names.
You can view your new project at `https://gitlab.example.com/namespace/myproject`.
Your project's visibility is set to **Private** by default, but you can change it
in your [project's settings](../../public_access/public_access.md#change-project-visibility)).
## Fork a project ## Fork a project
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment