Skip to content

Git over HTTPS

Amendable speaks Git Smart HTTP. If git clone works against GitHub over HTTPS, it works here. There is no SSH remote.

Clone host: amendable.io. Staging is stage.amendable.io. See Environments.

HTTPS Basic auth: username is you, password is the access token.
https://amendable.io/r/<username>/<repo>.git

Info refs:

GET https://amendable.io/r/<username>/<repo>.git/info/refs?service=git-upload-pack
GET https://amendable.io/r/<username>/<repo>.git/info/refs?service=git-receive-pack

You rarely call those yourself. git does.

Terminal window
amendable login
git config --global credential.https://amendable.io.helper '!amendable git-credential'
git clone https://amendable.io/r/USER/REPO.git

The helper prints username and password (the token) on get. It ignores store and erase.

amendable repo clone REPO does the clone and sets the helper on that repo only.

Required grants:

  • Clone and fetch: GIT_HTTP_READ
  • Push: GIT_HTTP_WRITE (read is added automatically)

Empty repositories have no default branch until you push one.

Terminal window
git switch -c main
git add .
git commit -m "Initial commit"
git push -u origin main

After that, GET /v1/repos/{user}/{repo}/branches returns default_branch and each branch tip. That endpoint needs API_COMMITS_READ or ALL.

import os
from urllib.parse import quote
import pygit2
user = os.environ["AMENDABLE_USERNAME"]
token = os.environ["AMENDABLE_TOKEN"]
repo = os.environ["AMENDABLE_REPO"]
url = f"https://{quote(user)}:{quote(token)}@amendable.io/r/{user}/{repo}.git"
callbacks = pygit2.RemoteCallbacks()
pygit2.clone_repository(url, "/tmp/amendable-clone", callbacks=callbacks)

Any HTTPS Git library works. There is no custom Git protocol.

Clone and fetch count as transfer (egress). Push bodies count as ingress (metered, not billed). Free accounts include 5 GiB transfer per UTC month. Hitting the free cap returns an error on Git HTTP. Paid plans have included transfer plus overage.

If the machine you are on is a poor Git client, a tiny EC2 box is enough:

  1. Amazon Linux 2023 or Ubuntu 24.04, t3.micro, us-west-2 is fine.
  2. Security group: SSH from your IP, or SSM only.
  3. sudo dnf install -y git or sudo apt-get install -y git
  4. Export AMENDABLE_TOKEN on that instance (or use amendable login if you can open a browser).
  5. Run the clone/commit/push commands from Quickstart.

You do not need IAM on that instance for basic Git. IAM is only for BYO S3 on the Amendable side.