20. origin/main is your memory of their note
A remote-tracking branch is a read-only bookmark of where the remote's branch was at last contact; Git moves it on fetch and push, and it goes stale in between.

20. origin/main is your memory of their note

A remote-tracking branch is a read-only bookmark of where the remote's branch was at last contact; Git moves it on fetch and push, and it goes stale in between.

"origin/main" appears in every status line and most people cannot say what it is.

Your clone has your branches. It also has notes like origin slash main.

Origin slash main is where origin's main was, the last time you looked. A bookmark, not a live view.

You cannot commit on it. Git moves it for you, when you fetch or push.

Someone pushes to origin. Your bookmark does not move. It is stale until you ask.

So two notes for one branch. Main is yours. Origin slash main is your memory of theirs.

Check yourself. Someone pushes to origin. Does your origin/main move?

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime

Attributes
name
20. origin/main is your memory of their note
summary
A remote-tracking branch is a read-only bookmark of where the remote's branch was at last contact; Git moves it on fetch and push, and it goes stale in between.