Skip to Content
We are live but in Staging 🎉
RecipesMirror a Repo to Dodil

Mirror a Repo to Dodil

Goal: an existing repository (GitHub, GitLab, a bare server, anywhere) lives in Dodil Git with its complete history, branches, and tags.

You need: the dodil CLI and a write credential — a dk_ API key with git.editor or better, or an uploaded SSH key (Auth and Access).

1. Create the target repo

dodil git repo create my-service --default-branch main dodil git clone-url my-service # HTTP: https://git.dodil.io/<repo_id>.git # SSH: [email protected]:<repo_id>.git

The repo starts empty — the first push materializes its branches.

2. Push everything

From your existing working clone — add Dodil as a second remote and push all branches and tags:

cd my-service git remote add dodil https://git.dodil.io/<repo_id>.git git push dodil --all git push dodil --tags

Or as a true mirror — a fresh bare clone pushes every ref in one shot (including remote-tracking branches your working clone doesn’t have locally):

git clone --mirror https://github.com/acme/my-service.git cd my-service.git git push --mirror https://user:[email protected]/<repo_id>.git

If the target branch pattern already has protection with block_force_push, a --mirror push that rewrites it will be rejected — mirror first, protect after.

3. Switch remotes

Make Dodil the origin for your day-to-day clone:

git remote set-url origin https://git.dodil.io/<repo_id>.git # credential helper recommended — see the CLI guide's Clone & Push page

Keep the old remote around under another name if you want a transition period of double-pushing.

Verify

dodil git branch list my-service # every branch, default marked * dodil git repo get my-service -o json # size_bytes reflects the import git ls-remote https://git.dodil.io/<repo_id>.git | head

Browse the code and history in the console’s repo view — tree, blobs, and commit log come straight from the pushed refs.

Next