Skip to content

Branches, tags, and releases

Create a branch.

Flags

  • -p, --project <value> — Project id, or its full path such as group/subgroup/project. (required; env: GITLAB_PROJECT)
  • --dry-run — Print the request that would be sent and exit without sending it.
  • --branch <value> — Name of the new branch. (required)
  • --ref <value> — Branch, tag, or commit SHA to branch from. (required)

Connection

  • -e, --env-file <value> — Path to a .env file holding connection settings.
  • --gitlab-url <value> — Base URL of the GitLab instance. Defaults to https://gitlab.com. (env: GITLAB_URL)
  • --gitlab-token <value> — Personal, project, or group access token. (env: GITLAB_TOKEN)

Global

  • --json — the raw API payload, for scripts and agents.

Points a new branch at an existing branch, tag, or commit SHA. GitLab refuses a name that already exists rather than moving it, so this can never rewrite a branch someone else is using.

Examples

Terminal window
simply gitlab branch create --project group/project --branch feature/thing --ref main
Terminal window
simply gitlab branch create --project group/project --branch hotfix --ref v1.2.0

List repository branches.

Flags

  • -p, --project <value> — Project id, or its full path such as group/subgroup/project. (required; env: GITLAB_PROJECT)
  • --limit <value> — Maximum number of branches to return across all pages. (default: 20)
  • --search <value> — Return only branches whose name contains this term.

Connection

  • -e, --env-file <value> — Path to a .env file holding connection settings.
  • --gitlab-url <value> — Base URL of the GitLab instance. Defaults to https://gitlab.com. (env: GITLAB_URL)
  • --gitlab-token <value> — Personal, project, or group access token. (env: GITLAB_TOKEN)

Global

  • --json — the raw API payload, for scripts and agents.

Branches come back in GitLab order, which is alphabetical rather than by recency, so on a busy repository —search is usually what you want. The MERGED column reflects whether the branch is merged into the default branch, not into whatever you are working on.

Examples

Terminal window
simply gitlab branch list --project group/project
Terminal window
simply gitlab branch list --project group/project --search release --limit 50

List releases for a project.

Flags

  • -p, --project <value> — Project id, or its full path such as group/subgroup/project. (required; env: GITLAB_PROJECT)
  • --limit <value> — Maximum number of releases to return across all pages. (default: 20)

Connection

  • -e, --env-file <value> — Path to a .env file holding connection settings.
  • --gitlab-url <value> — Base URL of the GitLab instance. Defaults to https://gitlab.com. (env: GITLAB_URL)
  • --gitlab-token <value> — Personal, project, or group access token. (env: GITLAB_TOKEN)

Global

  • --json — the raw API payload, for scripts and agents.

Releases are tags with notes and assets attached, so a project can have many tags and no releases at all. Use —json for the release notes, asset links, and the commit each release points at.

Examples

Terminal window
simply gitlab release list --project group/project
Terminal window
simply gitlab release list --project group/project --limit 5 --json

List repository tags.

Flags

  • -p, --project <value> — Project id, or its full path such as group/subgroup/project. (required; env: GITLAB_PROJECT)
  • --limit <value> — Maximum number of tags to return across all pages. (default: 20)
  • --search <value> — Return only tags whose name contains this term.
  • --order-by <value> — Field to sort by. (one of: name, updated, version)
  • --sort <value> — Sort direction. (one of: asc, desc)

Connection

  • -e, --env-file <value> — Path to a .env file holding connection settings.
  • --gitlab-url <value> — Base URL of the GitLab instance. Defaults to https://gitlab.com. (env: GITLAB_URL)
  • --gitlab-token <value> — Personal, project, or group access token. (env: GITLAB_TOKEN)

Global

  • --json — the raw API payload, for scripts and agents.

Tags come back newest first by the commit date they point at. That is the commit date, not the tag creation date, so a tag cut today on an old commit sorts by the old commit — use —order-by name if you need a deterministic order instead.

Examples

Terminal window
simply gitlab tag list --project group/project
Terminal window
simply gitlab tag list --project group/project --search v1. --limit 50