Gitlab default project visibility when creating projects from terminal

北城余情 提交于 2019-12-20 07:19:22

问题


Whenever I start a new project I add it to my Gitlab VCS (on-premise):

git init
git add .
git commit -m "Commit message"
git remote add origin git@git.example.com:foo.git
git push --set-upstream origin master

This results in:

Enumerating objects: 7, done.
Counting objects: 100% (7/7), done.
Delta compression using up to 4 threads
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 5.65 KiB | 2.82 MiB/s, done.
Total 7 (delta 0), reused 0 (delta 0)
remote:
remote: The private project foo was successfully created.
remote:
remote: To configure the remote, run:
...blah blah blah

However, this creates a private project. I can create projects in the web GUI; this respects the setting that I want new projects to default to internal (Admin > Settings > General > Visibility and access controls > Default project visibility).

I was wondering; is it possible to create a project as above, from the terminal, and specify the visibility (any one of private, internal or public)?


回答1:


Official docs say's no. Project's created from command line always set to Private by default.

https://docs.gitlab.com/ee/gitlab-basics/create-project.html#push-to-create-a-new-project

If you have access rights to the associated namespace, GitLab will automatically create a new project under that GitLab namespace with its visibility set to Private by default (you can later change it in the project’s settings)

You can change project level from UI or using Gitlab API.



来源:https://stackoverflow.com/questions/57395399/gitlab-default-project-visibility-when-creating-projects-from-terminal

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!