Commit 839829a7 authored by Tiago Botelho's avatar Tiago Botelho
Browse files

Adds documentation for the feature

parent dc229c07
......@@ -33,5 +33,43 @@
1. Click **Create project**.
## Push to create a new project
> [Introduced]( 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. That
will automatically create a new project under a GitLab namespace that you have access to
with its visibility set to private by default (you can later change it).
This can be done by using either SSH or HTTP:
## Git push using SSH
git push branch_name
## Git push using HTTP
git push branch_name
Once the push finishes successfully, a remote message will indicate
the command to set the remote and the URL to the new project:
remote: The private project namespace/nonexistent-project was created.
remote: To configure the remote, run:
remote: git remote add origin
remote: To view the project, visit:
If the project name is already in use, your push will be rejected
to prevent accidental overwriting the existing project.
[import it]: ../workflow/importing/
[reserved]: ../user/
......@@ -2,6 +2,8 @@
# class return an instance of `GitlabAccessStatus`
module Gitlab
class GitAccess
include Gitlab::Utils::StrongMemoize
UnauthorizedError =
NotFoundError =
ProjectCreationError =
......@@ -239,9 +241,11 @@ def can_read_project?
def can_create_project_in_namespace?(cmd)
return false unless push?(cmd) && target_namespace && project.blank?
strong_memoize(:can_create_project_in_namespace) do
return false unless push?(cmd) && target_namespace && project.blank?
user.can?(:create_projects, target_namespace)
user.can?(:create_projects, target_namespace)
def http?
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