Interview Prep/Git & GitHub/Hooks, submodules, LFS and signing

How do `git switch --detach` and `git checkout <tag>` differ from checking out a branch for releases?

IntermediateConceptHooks, submodules, LFS and signing
Answer

<details> <summary><b>Answer</b></summary>

A tag or SHA checkout gives a detached HEAD at an immutable point, which is exactly what you want for building a release reproducibly. Branch checkouts move over time. Release pipelines should build from a tag or SHA.

All Git & GitHub questions Roadmap: Git & GitHub

More on Hooks, submodules, LFS and signing