· Joseph Katsioloudes

Black Friday: Practice Your Git Host Going Down

Engineering

Across software engineering, practicing failover cases is a common way to prepare for the worst before disaster strikes. For years, I’ve seen that database failovers tend to be the most popular, followed by cyber attack tabletops where teams fight against zero-day vulnerabilities. But how many of us have actually practiced for an outage from our Git host, the productivity tool we rely on every single day to ship code?

I wrote this blog because I noticed a new and rising dimension of risk: availability issues caused by agents clogging the infrastructure of the Git hosts we historically relied on, resulting in a growing number of devs asking for a backup plan. Across social media, our Discord, and even among my own friends and colleagues, we all agree that the old adage is true: fail to prepare and you prepare to fail. Software has eaten the world. It should now be an industry-standard to keep a backup of your repo running, so that we can all continue pushing and building even when GitHub goes dark.

So why don't we, together, simulate a GitHub outage by cutting off local access (I used GitHub for the purposes of this exercise because it’s currently the most popular option, but you could simulate with any Git forge alternative). Don’t worry, though: you can restore access at any time, since this is a simulated cutoff. By the end of this drill, you’ll assess your readiness and understand how Entire can help in this scenario with minimal overhead.

What Breaks When Your Git Host Goes Down?

First things first: What is lost? When GitHub becomes unresponsive, you lose access to your repositories. However, if you have already mirrored your repositories to Entire, three things happen:

  • Reads can continue from every Entire region to which you mirrored your repo. Mirrors will keep serving those reads, enabling your agents to clone and pull without being affected.
  • Pushes to the mirrored branch will not work. They will fail because Entire will not be able to reach the upstream git server. This is an intentional design choice to prevent the mirror and upstream from falling out of sync.
  • If you use Entire-native branches (which you’ll discover at the end of this drill), you can keep pushing to those as if GitHub were live. This is because they never synchronize to GitHub in the first place.

One important caveat is that services living on GitHub’s website such as issues, pull requests, and Actions will not work during a GitHub outage. CI tools will be the subject of a future failover exercise on this blog, but for now, I’ve included them at the end of the steps as an optional side quest!

What Are My Options When It Happens?

The following table presents preparation overhead vs reconciliation cost, with the ability to push code during an outage being the holy grail:

OptionCan you write?Prep neededReconcile cost
Wait it outNoNoneNone (nothing to merge)
Borrow your teammate(s)’ clone(s)Yes, locally and between clonesAn available clone and a way to exchange commits through a communications channelLow (push collected commits, then a PR)
Second mirror on another hostYes, thereSync setup, write access, and a failover/recovery planMedium (resync both hosts)
Entire mirrorNo, reads onlyMirror configured and initial sync complete before the outage (takes 5 minutes, once)None (no writes to merge)
Entire-native branchesYesSame mirror, plus a branch-naming note for agentsLow (3 commands per branch, then a PR)

How Do I Run the Drill?

To run the drill, you need to be on macOS, Linux, or WSL on Windows. You need to have the Entire CLI installed, then log in with the command, and finally, have the Entire GitHub App authorized on the side repository for which you simulate the outage.

A quick note on scope: we will block github.com locally, i.e., only for your machine. If you're behind a proxy or have some unusual SSH setup, the block might not even bite. Don't worry about leaving things broken because we have a cleanup at the end that you can also choose to run at any time. Please note that Entire and your remote CI will still be able to reach GitHub.

Let’s get started:

  1. Pick a side repo on GitHub and mirror it to Entire. To do so, substitute your GitHub username or org for <owner>, and the repo name for <repo>:

    entire repo mirror add /gh/<owner>/<repo># for example: entire repo mirror add /gh/jkcso/goentireentire repo remote add entiregit fetch entire
  2. Now cut your machine off from github.com. Please note that other apps on your laptop will lose access to github.com too. To proceed, add the following line, with the comment at the end as a marker so we can easily find it later:

    sudo sh -c 'printf "\n127.0.0.1 github.com # entire-gameday\n" >> /etc/hosts'

    We'll restore access to github.com in step six, and you can skip to that step at any time, should you wish to abandon the exercise earlier.

  3. Next, let’s make sure the connection is indeed broken by running git ls-remote origin, which should now error out, while git fetch entire should still work. If direct access still gets through, stop and clean up as something (probably your network setup) is bypassing the hosts file.

    Pushing straight to origin should fail too. A push to a normal branch through Entire might still work, though, since Entire can see GitHub is still up and running. So don't read this as proof that mirrored writes fail in a real outage. Please remember to use fetch here and not pull, because the latter would merge into whatever branch you're currently on.

  4. Time to leave behind the mirrored branch (where pushes go to GitHub) in favor of an Entire-native one where pushes remain on Entire:

    git switch -c entire/unmirrored/gamedayprintf 'Game day test\n' > gameday.txtgit add gameday.txtgit commit -m "Record game day test"git push -u entire entire/unmirrored/gamedaygit rev-parse HEADgit ls-remote entire refs/heads/entire/unmirrored/gameday

    You should see the same hash twice above. To push to Entire-native branches during an outage, that prefix is really all you need. When you put a branch under entire/unmirrored/ it stays on Entire, no matter what region you’re pushing to. This proves that GitHub being down stops mattering.

    Now make another tiny change, commit it, and run git push. Check the hashes again. Want to verify reads independently? Grab the Entire remote URL with git remote get-url entire, clone it somewhere temporarily, check out the gameday branch and see if HEAD matches. For this one, stay in the same Entire region because native branches don't get copied to other regions.

    Personally, I automated Entire-native branch creation by adding instructions to my repo’s AGENTS.md. You can do so too by adding a line instructing your agents to use that prefix for branch names, and you can get more inspiration from our native branches guide, which has wording for your reference and inspiration.

    Time to test this out by handing your agent a task while GitHub is still cut off, and check its commits end up on an Entire-native branch. Your agent will pick its own branch names, so don't look only for “gameday.” Another tip: if your agent instructions require Entire session tracking, then you should run in the drill checkout before you start the agent.

  5. (Optional) Want to test CI as well?

    a. Set up a separate job that checks out the native branch from the same Entire region and builds it, then confirm it built the right commit.

    b. Write down what triggers it, what it depends on, the secrets it needs, and anything that still talks to the GitHub API or grabs artifacts from there. Keep in mind that a CI that passes the check here only means it's configured right. Only your laptop is cut off from GitHub; the CI runner can still reach it, so this proves nothing about CI in a real GitHub outage.

    For the CI lovers among us, Entire has CI integrations for Depot, Buildkite, Dagger, and RWX, so you don’t need to recreate your pipelines. Just bring them over!

  6. When you're done (or if you gave up halfway, no judgment), run the following to get GitHub back. It will first write a .entire-gameday.bak file, which is a copy of the hosts file with the block still in it, not how things were before the drill. Then run git ls-remote origin, which should now work. If it fails, your DNS cache probably hasn't caught up. Please wait a minute and try again.

    sudo sed -i.entire-gameday.bak '/^127\.0\.0\.1 github\.com # entire-gameday$/d' /etc/hosts

How Do I Reconcile After?

After the “outage” is over, you still need to push your Entire-native branches so they can find their way back to GitHub. To do so from entire/unmirrored/gameday, send the same commits to a fresh, ordinary branch on origin by running:

git push origin HEAD:gameday-recoverygit rev-parse HEADgit ls-remote origin refs/heads/gameday-recovery

These are the same checks as before, so the hashes should match. Repeat for each native branch. Since agents may have created their own branches, run git ls-remote entire 'refs/heads/entire/unmirrored/*' to list them all. After that, work as normal by opening a pull request and getting it reviewed before merging. And by the way, while we’re on the topic of pull requests: Entire has reimagined them for the era of agents. Check out our code review system, Trails, and thank me later!

What Did the Drill Teach You?

To assess your learnings and readiness against this drill, ask three questions:

  1. How long would it take to research, decide, and become productive while reacting to an outage in real conditions?
  2. What stopped dead (reviews, triage, deploys, something else) and how long can you afford to wait on it?
  3. What can you set up today so the real outage is a non-event?

Share This Drill Today

If you learned something new today, please encourage others to try out Entire and practice this failover case today. We also look forward to you coming over to our Discord to tell us more about your experience and feature requests. We're always happy to help out or answer questions.

Now, good luck on game day, and thanks for trying this drill.