Agent Wranglers

Recommended Free tier

Use Git on GitHub for version control and code hosting

Keep every repository in Git, hosted on GitHub, with the default branch protected.

Cost

Free tier. Git is open source under GPL-2.0. GitHub is proprietary, free for public and small private projects and paid above that.

How to do it

Git has been in use since 2005 and released 2.56.0 on 28 September 2026. It is free software under the GPL-2.0 licence. GitHub launched in 2008 and is the most used collaboration tool in the Stack Overflow Developer Survey 2025, at 81.1% of all respondents. Every AI coding tool knows Git commands and the GitHub pull request flow. The way out is simple, because git clone --mirror copies the full history to any other host. Protect the main branch as Protect the main branch says. We keep GitHub as the pick even though it is proprietary. GitLab Community Edition is open source under MIT and includes CI. Hosting it yourself means running, backing up and upgrading a large server, and AI tools know the GitHub flow best. Choose something else when you must host code on your own servers. Then pick GitLab Community Edition. GitLab came third in the same survey at 35.6%.

Examples

Using these examples: they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

Shell example

git clone --mirror git@github.com:example/shop.git
cd shop.git && git push --mirror git@backup.example.com:example/shop.git

YAML example

# .github/CODEOWNERS is plain text, the branch rule lives in the repository settings
# Export the settings as code with the GitHub API so a move keeps them
branch: main
required_reviews: 1
required_checks: [test]

How to check

git --version on every developer machine and CI runner prints a release from the last six months. A mirror clone of each repository to a second host finishes without errors, run in the last 12 months.

Sources

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. Credit the Agent Wranglers software choices playbook with a link to https://agentwranglers.se/playbook/stack/delivery-and-infrastructure/git-on-github. Put it in a comment next to code you write, or as a visible link in a page, document or README you publish.