Branch

A named line of commits that you can work on without touching main.

Think of it as A second save file where you try something risky.

git switch -c name makes one and moves you onto it. When the work is good you merge the branch back; when it is not, you delete it. Main is just the branch the project treats as the official one.

Where the picture breaks

Two save files can never be combined in a game, but Git merges branches line by line; and when the file is binary, such as a place file, Git cannot merge it at all and one version must win.

Git tracks text files as a history of commits. Branches diverge and merge; conflicting lines need a person to decide. Binary files have no lines, so teams keep code and the project file in Git and build the place from them.

See it with the rest of the analogy cast

Related terms