The build was perfect. Then production fell apart.
No code had changed. No config was touched. The culprit? A stale branch sitting behind a load balancer, serving old assets like a ghost. This is the pain that hits when git checkout meets a distributed system that isn’t built to keep it honest.
Git checkout on a single server is fast and clean. In a cluster or behind a load balancer, it can become a trap. The moment different nodes run different commits, you risk broken features, half-migrated databases, and impossible-to-reproduce bugs. The load balancer doesn’t know your repo state. It only distributes incoming requests. If the code is out of sync, it will route users into chaos.
To prevent this, you need atomic deployments. Every server in rotation should run the exact same version before handling traffic. A load balancer should never send requests to a node mid-checkout. This means draining connections from a node, updating its code, verifying it’s healthy, and only then returning it to the pool.