Skip to Content
GitDBDocs
Getting started

Personal access tokens

Create, use, and revoke personal access tokens for scripts, CI runners, and Git over HTTPS.

A personal access token lets a script, a CI runner, or Git over HTTPS act as you without your password. "Tokens inherit your user permissions, scoped further by the chosen scopes": a token can never do more than your own account can, and you narrow it further with scopes and an expiry date.

Tokens live in Settings → Personal access tokens. You can also get there from New → New access token in the top bar, or Personal access tokens in the account menu.

Create a token

  1. Click Generate new token.
  2. Fill in the Generate new token dialog:
    • Token name: something that tells you later where it's used, for example CI runner — production.
    • Scopes: tick at least one. repo:read and git:read are ticked by default. Pick the narrowest set that fits the use case.
    • Expiration: how long the token stays valid.
    • Source identifiers: the networks the token may be used from — your current network's verified IP is pre-selected. On a connection whose address changes (home DHCP, hotspot), Allow my whole network (a.b.0.0/16) adds your network's range in one click (details).
  3. Click GENERATE TOKEN →.
  4. The dialog now shows Token … created and the token itself under One-time display. Click COPY TOKEN, store it somewhere safe (for example your CI system's credential store), then click DONE →.

Copy the token before you close the dialog. You will not be able to see it again. If you lose it, revoke it and create a new one.

Tokens and SSH keys are created only from a signed-in browser session. A personal access token can't create another token or add an SSH key, whatever its scopes: the request is refused with insufficient_scope. A token can still be revoked.

A token created in the browser from the same address you signed in from sends no "token was created" email — see Access log.

Scopes

ScopeWhat it allows
repo:readRead repositories and metadata, including clone and fetch via git-over-HTTPS
repo:writeCreate branches, commits, refs
repo:adminFull administrative control over repositories — everything repo:write allows, plus deleting repositories and managing their hooks, branch protection and read-ACL rules (your org role still applies); organization members, invitations, teams and settings are managed in the browser only
git:readClone and fetch via git-over-HTTPS, and read code and history
git:writePush via git-over-HTTPS
user:readRead your account settings (usage meter, 2FA, security identifiers, IP allowlist, AST-index consent, tokens, SSH keys) — it grants no repository reads
checks:writePost CI check statuses through the REST API's /checks/report — nothing else: it grants no repository reads or writes and no MCP tools. Give a CI job that only reports statuses a token with just this scope. Your organization role must still allow writing.

Every way of reading needs a read scope. Cloning, fetching and Git LFS over HTTPS, and the REST API's code and history reads, need git:read, git:write, repo:read, repo:write or repo:admin. The REST API's pull request, check, memory, repository-list and audit reads need repo:read (or repo:write / repo:admin). A token holding only checks:write or user:read reads no repository content; a REST read its scopes don't cover is refused with HTTP 403 insufficient_scope.

Expiration

OptionToken is valid for
30 days30 days from creation
60 days60 days from creation
90 days (default)90 days from creation
1 year365 days from creation
No expiration (not recommended)Until you revoke it

Once a token expires it's refused, exactly like a revoked token.

Use a token with Git over HTTPS

Every repository can also be reached over HTTPS at https://gitdb.net/{org}/{repo}:

git clone https://gitdb.net/{org}/{repo}

When Git asks for credentials, enter any username and paste your token as the password.

  • To clone and fetch, a token with git:read is the narrowest choice. A token with no read scope — for example one holding only checks:write or user:read — is refused clone, fetch and Git LFS with HTTP 403 (read refused: this personal access token has no git read scope).
  • To push, the token needs git:write (or repo:write). A token without a write scope can clone and fetch but can't push.
  • Branch protection rules apply to HTTPS pushes exactly as they do over SSH. See Branch protection.

Use your operating system's Git credential helper to store the token instead of typing it each time. If you'd rather not handle tokens at all, use SSH keys.

Use a token with your AI agent (MCP)

Your agent connects to GitDB's MCP server with a token — see Connect your AI agent. Each MCP tool checks the token's scopes:

ScopeWhat it allows over MCP
repo:readEvery tool that reads: code, history, pull requests, checks, memory recall, and gitdb_list_repos (your organizations and the repositories your token can access)
repo:writeEverything repo:read allows, plus every tool that writes: staging and committing, branches, tags and merges, opening, reviewing, merging and closing pull requests, saving and forgetting memories, and creating repositories (gitdb_create_repo)
repo:adminEverything repo:write allows
git:readThe code and history reads only — not pull requests, checks, memory, or gitdb_list_repos
git:writeEverything git:read allows, plus staging, committing, branches, tags and merges — not pull request writes, memories, or creating repositories
user:readNone of the repository tools — only gitdb_scan_secrets, which checks just the content you pass
checks:writeNo MCP tools — the scope grants none, so a token holding only checks:write reaches just gitdb_scan_secrets, like user:read. It's for posting CI check statuses through the REST API's /checks/report only

A call the token's scopes don't cover is refused with insufficient_scope, naming the scope it needs, and nothing is read or changed; your agent's tool list leaves those tools out. Writes also need an organization role that can write.

Your token list

Each token in the list shows its name, its scopes, when it was Last used (or "never"), and when it expires (or "no expiration").

Revoke a token

  1. Click the delete icon next to the token.
  2. A confirmation dialog titled with the token's name warns: "Any CLI sessions or scripts using this token will stop working immediately. This cannot be undone."
  3. Click REVOKE TOKEN →.

Revoke a token right away if it may have leaked, and create a new one for whatever used it.

Good practice

  • One token per use (per CI pipeline, per script), so you can revoke one without breaking the others.
  • Pick the narrowest scopes and a real expiry date rather than No expiration (not recommended).
  • Never commit a token to a repository or paste it into chat.

On this page