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.
Remote URL
Section titled “Remote URL”https://amendable.io/r/<username>/<repo>.gitInfo refs:
GET https://amendable.io/r/<username>/<repo>.git/info/refs?service=git-upload-packGET https://amendable.io/r/<username>/<repo>.git/info/refs?service=git-receive-packYou rarely call those yourself. git does.
Credentials
Section titled “Credentials”amendable logingit config --global credential.https://amendable.io.helper '!amendable git-credential'git clone https://amendable.io/r/USER/REPO.gitThe 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.
git clone "https://USER:${AMENDABLE_TOKEN}@amendable.io/r/USER/REPO.git"Works, but the token lands in .git/config. After the clone:
git remote set-url origin "https://amendable.io/r/USER/REPO.git"printf '%s\n' '#!/bin/sh' 'echo "$AMENDABLE_TOKEN"' > /tmp/askpasschmod 700 /tmp/askpassGIT_ASKPASS=/tmp/askpass git clone https://amendable.io/r/USER/REPO.gitGit still sends a username. Any non-empty username is fine when the password is a valid token.
Required grants:
- Clone and fetch:
GIT_HTTP_READ - Push:
GIT_HTTP_WRITE(read is added automatically)
First push
Section titled “First push”Empty repositories have no default branch until you push one.
git switch -c maingit add .git commit -m "Initial commit"git push -u origin mainAfter that, GET /v1/repos/{user}/{repo}/branches returns default_branch and each branch tip. That endpoint needs API_COMMITS_READ or ALL.
libgit2 / pygit2
Section titled “libgit2 / pygit2”import osfrom 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.
Transfer metering
Section titled “Transfer metering”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.
EC2 smoke test
Section titled “EC2 smoke test”If the machine you are on is a poor Git client, a tiny EC2 box is enough:
- Amazon Linux 2023 or Ubuntu 24.04,
t3.micro,us-west-2is fine. - Security group: SSH from your IP, or SSM only.
sudo dnf install -y gitorsudo apt-get install -y git- Export
AMENDABLE_TOKENon that instance (or useamendable loginif you can open a browser). - 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.