We have a gitlab
setup at our office, and we have somewhat around 100-150 project each week to create over there, while Admin wants to keep the control of creating repos and assigning teams to it, it seems quite a bit of task for anyone to create that many repos every week.
Is there a way to create repo on Gitlab using CLI
- I won't mind if i have to use ssh
for it.
In the command line, navigate to the root directory of your project. Initialize the local directory as a Git repository. Stage and commit all the files in your project. To create a repository for your project on GitHub, use the gh repo create subcommand.
After creating your account in GitLab, go to your Projects page and click New project. From the Blank project tab, give the project a name and add a description. If you want it to be a public repository, click the Public option. Make sure the Initialize repository with README option is left unchecked.
GLab is an open source Gitlab Cli tool written in Go (golang) to help work seamlessly with Gitlab from the command line. Work with issues, merge requests, watch running pipelines directly from your CLI among other features.
gitlab-cli is no longer maintained, the author references the Gitlab module to be used instead - it also includes a CLI tool.
For your specific request - namely creating a project on the command line, use the following command:
gitlab create_project "YOUR_PROJECT_NAME" "{namespace_id: 'YOUR_NUMERIC_GROUP_ID'}"
Be sure to use the option namespace_id
and not group_id
! If you are not sure what your GROUP_ID
is, you can use
gitlab groups | grep YOUR_GROUP_NAME
to find out.
The parameters for each command can be inferred from the API documentation. Any non-scalar valued parameter has to be encoded in an inline YAML syntax (as above).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With