← Module 08 · Development & Git
PART VIII · DEVELOPMENT & GIT

Main

The primary branch that usually represents the main shared code line in a Git repository.

01

What is it?

Main is the primary branch that usually represents the main shared code line in a Git repository.

Main is the shared branch that represents the project’s central line of development.

02

Think of it like...

Think of a repository as a project with several working paths. Main is the shared path that the team returns to when work is ready to be combined.

MainThe shared path
Other branchesSeparate paths for changes
03

What does it do?

Main gives a team a shared place for the central version of the project.

Shared BaseProvides a common starting point.
Combined WorkReceives changes that are ready to join the project.
Team ReferenceShows the version the team treats as central.
Release Starting PointCan provide code for a release or deployment workflow.
04

Where is it used?

Main is used in Git repositories, team development workflows, code review, continuous integration, and release workflows.

Git Repositories
Team Development
Code Review
Release Workflows
05

Example

A team is building a website. A developer creates a separate branch for a change, commits the work, and opens a pull request. After review, the change is merged into main.

Starting point

The developer starts from main.

Separate work

The developer makes changes on another branch.

Review

The team checks the proposed change.

Combine

The approved change is merged into main.

06

How it connects

RepositoryMainFeature BranchCommitPull RequestCode ReviewMerge to Main

Main connects shared code with the branch, review, and merge workflow.

07

Do Not Confuse

Main ≠ Every Branch

Main is one branch with a special shared role. Other branches are usually used for separate work.

Main ≠ GitHub

Main is a branch. GitHub is a platform that can host and collaborate on repositories.

Main ≠ Production

Main may be connected to deployment, but it is not automatically the live production environment.

Main is a branch with a shared role, not a separate version-control system.

08

Topic Glossary

ENGLISH TERM中文SIMPLE ENGLISH中文小白理解
Main主分支The primary branch that usually represents the main shared code line.通常代表项目主要共享代码线的主分支。
Branch分支A separate line of work in a Git repository.仓库中用于独立开发的一条代码线。
Repository代码仓库A project directory tracked by Git.由 Git 跟踪和管理的项目目录。
GitGit 版本控制A tool for tracking changes in source code.用来记录和管理源代码变化的工具。
Commit提交A recorded set of changes in a repository.仓库中被记录下来的一组代码修改。
Pull Request拉取请求A request to review and combine changes into another branch.请求团队评审并把修改合并到另一条分支。
Code Review代码评审Checking proposed code changes before they are combined.代码合并前检查和讨论准备提交的修改。
Merge合并Combining changes from one branch into another.把一条分支上的修改合并到另一条分支。
Default Branch默认分支The branch a repository uses as its usual starting point.仓库通常默认使用的起始分支。
09

What to Remember

Main is the primary shared branch that gives a Git project a central line for combining, reviewing, and releasing code.

MainBranchReviewMergeMain
↑