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
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
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