Frequent questions about branches: how to name them, when to merge, and why Git branches are cheap.
- Why are Git branches cheap?
Because they are 40-byte files, not directory copies. Creating a branch does not copy files; it writes one reference.
- How to name a branch?
By concern, not by author:
fix/login-timeout, notjohn-dev. The name should predict the merge commit.- When to merge?
When the branch is ready and main has moved forward; daily in trunk-based development.
- Why does GitHub default to `main`?
Because
masterhas uncomfortable connotations in some contexts andmainis shorter and clearer. Purely a convention.