从终端创建项目时,Gitlab默认项目可见性 [英] Gitlab default project visibility when creating projects from terminal

查看:558
本文介绍了从终端创建项目时,Gitlab默认项目可见性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

结果是:


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中创建项目.这符合我希望新项目默认为内部的设置(管理>设置>常规>可见性和访问控制>默认项目可见性).

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)?

推荐答案

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

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

如果您具有关联名称空间的访问权,则GitLab将在该GitLab名称空间下自动创建一个新项目,默认情况下其可见性设置为Private(您可以稍后在您可以通过UI或使用Gitlab API更改项目级别.

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

这篇关于从终端创建项目时,Gitlab默认项目可见性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆