Skip to main content
Version: 0.15 (glpkg CLI)

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
OptionDescription
--path <localPath>Local directory to initialize (created if missing)
--create-groupsCreate 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-runShow what would be done
--verboseDetailed output
--no-pushDo not push after creating
--mirrorPush all branches and tags, not just the current branch

With --path:

  • An existing Git repository: the origin remote 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, branch main, origin set, and if it contains files, an Initial commit is created and pushed.

clone​

glpkg repo clone your-org/utils
glpkg repo clone your-org/utils --path ./src/utils
OptionDescription
--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
OptionDescription
--token <token>Use this token instead of the saved one
--host <host>GitLab host
--verboseDetailed output

Update your local origin remote afterwards (GitLab redirects the old path for a while).