glpkg repo
Create, clone and rename GitLab repositories.
glpkg repo create [options] <repoPath>
glpkg repo clone [options] <repoPath>
glpkg repo rename [options] <currentPath> <newName>
<repoPath> is the full path, for example your-org/tools/utils.
create
Creates a GitLab project. With --path, it also sets up a local directory as its Git
repository and pushes it.
glpkg repo create your-org/utils --dry-run
glpkg repo create your-org/utils --path ./utils --visibility internal
glpkg repo create your-org/new-team/utils --create-groups
| Option | Description |
|---|---|
--path <localPath> | Local directory to initialize (created if missing) |
--create-groups | Create missing parent groups |
--visibility <type> | private, internal or public (default from config defaults repo.visibility, else private) |
--description <desc> | Project description |
--token <token> | Use this token instead of the saved one |
--host <host> | GitLab host (default: config defaults host, else gitlab.com) |
--dry-run | Show what would be done |
--verbose | Detailed output |
--no-push | Do not push after creating |
--mirror | Push all branches and tags, not just the current branch |
With --path:
- An existing Git repository: the
originremote is set to the new project's SSH URL, then the current branch is pushed (or everything, with--mirror). - A new or plain directory:
git init, branchmain,originset, and if it contains files, anInitial commitis created and pushed.
clone
glpkg repo clone your-org/utils
glpkg repo clone your-org/utils --path ./src/utils
| Option | Description |
|---|---|
--path <localPath> | Target directory (default: the project name) |
--host <host> | GitLab host |
--token <token> | Use this token instead of the saved one |
Clones over SSH, and falls back to HTTPS if SSH fails. The target directory must not exist.
rename
Changes both the path and the name of a project.
glpkg repo rename your-org/utils shared-utils
| Option | Description |
|---|---|
--token <token> | Use this token instead of the saved one |
--host <host> | GitLab host |
--verbose | Detailed output |
Update your local origin remote afterwards (GitLab redirects the old path for a while).