What is master?
In Git, “master” is the name traditionally given to the default primary branch of a repository. A branch is like a timeline of code changes, and the master branch usually holds the most stable, production‑ready version of the project.
Let's break it down
- Repository: a folder that stores all your project files and their history.
- Commit: a snapshot of the project at a specific point in time.
- Branch: a separate line of development that can diverge from other lines.
- Master branch: the first branch created when you init a repo; it’s the main line where completed work is merged.
Why does it matter?
The master branch acts as the single source of truth for the project. Team members know that code on master should be tested, stable, and ready to be released. It simplifies coordination, continuous integration pipelines, and deployment processes.
Where is it used?
Almost every Git‑based project has a master (or now often “main”) branch: open‑source libraries on GitHub, corporate codebases, personal projects, and CI/CD tools that automatically build from the default branch.
Good things about it
- Provides a clear, default place for stable code.
- Widely supported by tools, tutorials, and documentation.
- Makes onboarding new contributors easier because they know where to look for the latest release‑ready code.
Not-so-good things
- The name “master” can be confusing or carry unwanted historical connotations, leading many communities to rename it to “main”.
- Relying on a single default branch can hide the importance of feature branches and proper release workflows.
- Some older scripts assume the branch is called “master”, so renaming may require updates to automation.