> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tensorlake.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Git Repositories

> Scalable Tensorlake-hosted git repositories for agents

Tensorlake repositories are ordinary Git repositories. They speak the standard Git smart HTTP protocol, so you can clone, branch, commit, merge, push, and fetch with ordinary `git`.

This page covers the plain Git interface — everything here happens in a clone, with ordinary `git`. Use [Repository Mounts](/git/workspace-mounts) when an agent should work inside a mounted directory, persist snapshots, and promote when ready; [Git or the tl CLI?](/git/introduction#git-or-the-tl-cli) is the one-rule guide for choosing between them.

Use [Repository SDKs](/git/repository-sdks) when you want to create repositories, inspect refs, push worktrees, or merge branches from Python or TypeScript.

## Create a Repository

```bash theme={null}
$ tl git create agent-outputs --default-branch main
created https://git.tensorlake.ai/project_9f3c2a1b/agent-outputs
```

`project_9f3c2a1b` is the project your `tl` login is scoped to. You do not pass it to every command.

You can also create a repository lazily by pushing to a repository path that does not exist yet. Lazy creation only applies to `git push`; `git clone` and `git fetch` require the repository to already exist.

## Get a Credential

Tensorlake authenticates Git operations with HTTP Basic Auth, not SSH keys.

First make sure you are logged in:

```bash theme={null}
tl login
```

Then mint a short-lived repository credential:

```bash theme={null}
$ tl git token --repo agent-outputs
project: project_9f3c2a1b
repo: agent-outputs
username: t
password: eyJhbGciOiJFUzI1NiJ9.eyJpc3MiOiJwcm9qZWN0XzlmM2MyYTFiIiwicmVwbyI6ImFnZW50LW91dHB1dHMifQ.Kx9f... (truncated)
expires: 2026-07-07T13:00:00Z
scopes: git:read, git:write
```

The username is always `t`. The password is the token.

## Clone

Use Git's credential store:

```bash theme={null}
git config --global credential.helper store
git clone https://git.tensorlake.ai/project_9f3c2a1b/agent-outputs
Username for 'https://git.tensorlake.ai': t
Password for 'https://t@git.tensorlake.ai': <paste the token>
```

Or embed the token in the URL for scripts and CI:

```bash theme={null}
TOKEN=$(tl git token --repo agent-outputs --json | jq -r .token)
git clone https://t:$TOKEN@git.tensorlake.ai/project_9f3c2a1b/agent-outputs
```

If the token is in a URL, treat the URL as a secret.

## Branch, Commit, and Push

From here, it is ordinary Git:

```bash theme={null}
git checkout -b feature
# edit files
git add .
git commit -m "implement parser"
git push origin feature
```

## Merge Changes

Tensorlake does not add a pull-request layer on top of Git repositories. Merge locally, then push the result:

```bash theme={null}
git checkout main
git pull origin main
git merge feature
git push origin main
```

A non-fast-forward push is rejected. Pull, resolve conflicts, and push again.

## What Plain Git Does Not Cover

* Workspaces, snapshots, promotion, and rebase are the mount model for agent sessions. See [Repository Mounts](/git/workspace-mounts).
* Workspace refs such as `refs/workspaces/...` are reserved on the server and cannot be updated with direct `git push`.
* Archived repositories are read-only until restored with `tl git restore <repo>`.

<CardGroup cols={2}>
  <Card title="Repository Mounts" icon="folder-tree" href="/git/workspace-mounts">
    Mount repositories as directories for agent sessions.
  </Card>

  <Card title="Merging Changes" icon="code-merge" href="/git/merging">
    Land workspaces on moved branches and merge branches directly.
  </Card>

  <Card title="Repository SDKs" icon="rectangle-code" href="/git/repository-sdks">
    Create repositories, push worktrees, and merge branches from Python or TypeScript.
  </Card>

  <Card title="Authentication" icon="key" href="/git/authentication">
    `tl login`, Git credentials, scopes, and token lifetime.
  </Card>

  <Card title="Architecture" icon="cubes" href="/filesystems/architecture">
    How storage, lazy content delivery, merging, and observability work.
  </Card>
</CardGroup>
