Skip to content

Git

The Git connector talks plain Git. It clones and walks repositories regardless of whether they live on GitHub, GitLab, Bitbucket, Gitea, Gerrit, or a plain git:// server. Use it when the provider isn't covered by a more-specific connector, or when you want a uniform view across providers.

For GitHub-specific features (PRs, Actions, Issues, Code Search), prefer the GitHub connector.

Configure

bash
curl -X POST http://localhost:8080/api/v1/sources \
  -H "authorization: Bearer $TOKEN" -H 'content-type: application/json' \
  -d '{
    "name":"git-mono",
    "connector":"git",
    "realm":"development",
    "config":{
      "url":"https://gitlab.internal/acme/monolith.git",
      "auth":{"kind":"https_token","username":"oauth2","token":"glpat-…"},
      "ref":"main",
      "shallow": true,
      "include_path_globs":["src/**","packages/**"]
    }
  }'

Auth:

  • ssh_key — private key, optional passphrase. Public key is derived.
  • https_token — for HTTPS URLs with tokens (GitLab oauth2+token, Bitbucket app password, etc.).
  • none — public repos.

shallow: true does a --depth=1 clone — fast, but no full history.

What it ingests

Graph labelFrom repo
:GitRepositorythe repo itself
:GitBranchbranches (local + remote)
:GitTagtags
:GitCommitcommits in tracked refs
:GitFilefiles in HEAD (optionally filtered by glob)
:GitAuthorcommitters/authors

Edges: AUTHORED_BY, PARENT_OF, ON_BRANCH, TAGGED_AS, CONTAINS_FILE.

Tools (read)

  • git.log(ref, limit, since) — commit log.
  • git.show(commit_sha) — commit metadata + diff.
  • git.file(path, ref?) — contents of a file at a ref (or HEAD).
  • git.grep(pattern, include?, exclude?) — server-side git grep.
  • git.diff(ref_a, ref_b, path?) — unified diff.

Tools (write, approval-gated)

  • git.branch(name, from) — create a branch.
  • git.commit(files, message, author?) — commit changes in an existing working tree (used from inside CIAB sessions).
  • git.push(ref) — push to the configured remote.

Writes require the auth method to be a write-capable token; otherwise they fail fast with permission_denied.

Incremental sync

The connector keeps the clone on disk at ${AGENTCY_DATA_DIR}/git/<source_id>/. Subsequent syncs run git fetch --prune and only upsert commits newer than the last run (since = previous HEAD sha).

To force a clean clone, POST /sources/:id/reindex.

Gotchas

  • Huge repos + include_path_globs. The walker still clones the whole repo (Git has no path-limited clone), it just skips ingestion outside the globs. Use shallow to cap disk.
  • LFS pointers are indexed as tiny blobs unless config.lfs: true is set. Enabling LFS pulls large files into AGENTCY_DATA_DIR.
  • Credentials for signed commits. We don't sign commits from this connector. Use CIAB with GPG config in the sandbox if you need signatures.

Next

Built by AgentcyLabs. For in-house deployment or Agentcy Cloud (PaaS) access, visit agentcylabs.com.