skipnothing/Git

Remotes

You clone a coworker's repo, add their URL, and expect a live wire to their machine. Open .git/config instead: two text lines got written, and no connection was ever opened.

  • ▸Saving a coworker's address writes two text lines to .git/config and opens no connection at all.
  • ▸Downloading their work never touches the branches you commit to; it only grows the object store and the origin/* copy.
  • ▸"Up to date with origin/main" measures you against your last download, not against what the team has committed since.
BUILDS ON
01

Two lines in .git/config

A teammate shares a repo at git@example.com:team/app.git. You run git remote add origin git@example.com:team/app.git and brace for a download. Nothing downloads. Open .git/config and there is a new block: a url line and a fetch line. That is the entire remote. It is a saved address plus a rule for where copied branches should land, sitting in a text file on your disk. No socket opened, no bytes crossed the network. The name origin is just the label you gave that address, and you can add as many as you like.

ADD A REMOTE, WATCH THE CONFIG FILE, NOT THE NETWORK

Keep going, sign up to unlock the rest

3 more parts in this topic, plus 18+ more topics in Git.

Sign up, it's freeSee the full Git