Skip to content

Commits

Commit several file changes at once.

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> — Branch to commit to.
  • --message <value> — Commit message.
  • --actions <value> — JSON array of file actions.
  • --start-branch <value> — Branch to create —branch from, if it does not exist.
  • --start-sha <value> — Commit SHA to start the new commit from.
  • --author-email <value> — Commit author email.
  • --author-name <value> — Commit author name.
  • --force — Overwrite the branch with the new commit.
  • --body <value> — Raw JSON request body.
  • --body-file <value> — Path to a file holding the raw JSON request body.

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.

Sends one commit containing a batch of actions — create, update, delete, move, chmod — which is how GitLab writes more than one file atomically. The actions are JSON, supplied with —actions or inside a —body-file, because there is no readable flag form for a list of file operations.

Each action is an object with an “action” and a “file_path”; create and update also need “content”, move needs “previous_path”, and chmod needs “execute_filemode”. Those rules are checked before anything is sent, so a bad entry names its own index.

Use —dry-run to see exactly what would be sent.

Examples

Terminal window
simply gitlab commit create --project group/project --branch main --message "chore: tidy" --actions '[{"action":"delete","file_path":"old.txt"}]'
Terminal window
simply gitlab commit create --project group/project --branch main --message "feat: batch" --body-file ./commit.json --dry-run

Show the changes a commit made.

Flags

  • -p, --project <value> — Project id, or its full path such as group/subgroup/project. (required; env: GITLAB_PROJECT)
  • --sha <value> — Commit SHA, or the name of a branch or tag. (required)
  • --stat — List the changed files without printing the hunks.

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.

Prints the unified diff for each file the commit touched. GitLab truncates very large diffs server-side and says so in the payload, so —stat is worth reaching for first on a big commit: it lists the files without any hunks.

Examples

Terminal window
simply gitlab commit diff --project group/project --sha 9a1b2c3
Terminal window
simply gitlab commit diff --project group/project --sha 9a1b2c3 --stat

List repository commits.

Flags

  • -p, --project <value> — Project id, or its full path such as group/subgroup/project. (required; env: GITLAB_PROJECT)
  • --limit <value> — Maximum number of commits to return across all pages. (default: 20)
  • --ref <value> — Branch, tag, or SHA to list from. Defaults to the default branch.
  • --path <value> — Only commits that touched this file or directory.
  • --since <value> — Only commits on or after this ISO 8601 timestamp.
  • --until <value> — Only commits on or before this ISO 8601 timestamp.
  • --author <value> — Only commits by this author name or email.
  • --stats — Include per-commit line counts in the JSON payload.

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.

Walks the history of a ref, newest first. —path narrows to commits that touched one file or directory, which is the fastest way to answer “when did this change and who changed it”.

—since and —until take ISO 8601 timestamps (2026-01-31T00:00:00Z); a bare date works too.

Examples

Terminal window
simply gitlab commit list --project group/project --ref main --limit 10
Terminal window
simply gitlab commit list --project group/project --path src/index.ts
Terminal window
simply gitlab commit list --project group/project --since 2026-01-01 --until 2026-02-01

Show one commit.

Flags

  • -p, --project <value> — Project id, or its full path such as group/subgroup/project. (required; env: GITLAB_PROJECT)
  • --sha <value> — Commit SHA, or the name of a branch or tag. (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.

Accepts a full or short SHA, or the name of a branch or tag — in which case the commit at its tip is shown, so the answer changes as the branch moves. Use commit diff for the changes themselves.

Examples

Terminal window
simply gitlab commit view --project group/project --sha 9a1b2c3
Terminal window
simply gitlab commit view --project group/project --sha main --json