The room is silent except for the hum of the server. No Wi-Fi. No Ethernet. No way out. You still need to switch branches.
Working with Git in an air-gapped environment is a test of discipline. There’s no remote fetch to save you. No quick clone from the network. Every command, every file, every commit is local. To use git checkout here, you rely only on what you’ve already brought into the system by trusted physical media. This is what makes it secure—and what makes it slow, unless you prepare well.
Start by making sure the repository is complete before bringing it into the air-gapped network. That means pulling down all required branches, tags, and submodules in a connected environment. Run:
git fetch --all --prune
git checkout <branch>
Make sure you’ve checked out and built every branch you might need. Once the code is inside your restricted environment, switching branches with git checkout will be instantaneous, because you have everything locally.
Avoid detached HEAD states unless necessary—on an isolated system, that can cause confusion when handing off work between teammates. Keep your commit history clean, and document branch purposes clearly, since you won’t have an online tracker to back you up.