Git is easier when you can see it move. Each figure is a small machine whose working is the idea: commits are wagons, branches are roads, a remote is a second yard. Open one and the mechanism explains the command.
Read them in order. Each figure has a written counterpart in Simplified Technical English.
-
Fig 1Staging
Packing bench
You edit on the bench, add puts a change in the tray, and commit seals the tray into a crate on the rack. A change left on the bench is not in the commit.
-
Fig 2Branch & merge
Signal-box junction
Commits are wagons and branches are roads. main runs A-B-C-F, feat leaves the line at B and runs D-E, and F is a merge commit with two parents.
-
Fig 3Clone
Mill that makes copies
clone copies the whole history, not only the files, and adds two names you did not have: origin, and origin/main.
-
Fig 4Remotes
Goods yard, two bays
A remote is another copy of your wagons. push lifts one to the far bay, fetch downloads without merging, and pull also puts it on your road.
-
Fig 5Conflicts
Two roads, one berth
A conflict is not a fault in git. Two branches change the same line, so git has two answers for one place, stops, and waits for a person.
-
Fig 6Rebase
Gantry over two beds
Rebase does not merge. It replays your commits on a new base, so they return with new ids, a straight history, and no merge commit.
-
Fig 7Pull request
Goods gate, review lamp
A pull request is a gate, not a move. Your branch cannot reach main until a reviewer clears it, and then the merge commit appears.
-
Fig 8Tags
Plate press
A branch name moves every time you commit. A tag does not move, which is why a release is a tag and v1.0 always means the same code.