You are signed in. Close

You are signed out. Close

Thank you. Your subscription has started. Close

Thank you. You will get an email when a new comic comes out. Close

We could not confirm your payment. If you paid, use the link "Sign in" at the bottom of the page. Close

Something went wrong on our side. Please try again in a moment. Close

Previous episode Git branches: how to try a risky idea without touching the main version

How Git keeps every version of your project without filling your disk

git switch: what really happens to your files when you change branch

Change branch in Git, and the files in your folder change under your eyes: days of work vanish, an older version comes back. Where does the work go, and what is HEAD?

  1. 1 Miva drops by and wants to play, on your laptop, the version she knows from main. Your folder shows the half-made night sky, and that is not it.MivaCan I playmy version?night sky, half made

    Miva drops by and wants to play, on your laptop, the version she knows from main. Your folder shows the half-made night sky, and that is not it.

  2. 2 You run git switch main, and in a blink the night sky is gone from your folder. Did two days of work just vanish?youWhere didmy sky go?git switch main

    You run git switch main, and in a blink the night sky is gone from your folder. Did two days of work just vanish?

The rest of this episode is for subscribers

Subscribe to read every premium episode. You can cancel when you want.

Paid yearly: $99 instead of $119.88

Next episode Git fast-forward merge: what happens when only one branch moved

Share this comic

More comics