从终端创建项目时 Gitlab 默认项目可见性

Gitlab default project visibility when creating projects from terminal

每当我开始一个新项目时,我都会将它添加到我的 Gitlab VCS(内部部署)中:

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

这导致:

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

但是,这会创建一个 私有 项目。我可以在 Web GUI 中创建项目;这符合我希望新项目默认为 internal 的设置(管理 > 设置 > 常规 > 可见性和访问控制 > 默认项目可见性)。

我在想;是否可以从终端创建上述项目,并指定可见性(私有、内部或 public 中的任何一个)?

官方文档说没有。默认情况下,从命令行创建的项目始终设置为私有。

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)

您可以从 UI 或使用 Gitlab API 更改项目级别。