A Genuinely Real Remote
git init --bare --initial-branch=master ../recipes-origin.git
A real bare repository — Git data only, no working directory, exactly the shape GitHub's own servers use.
Registering It as origin
git remote add origin ../recipes-origin.git
git remote -v
"origin" is just a convention, not a magic word — but it is the one every real Git host and every real developer expects.
The First Real Push
git push -u origin master
-u (--set-upstream) does two real things at once: sends every commit master has, and links master to origin/master so every future push just needs git push, no arguments.
What origin/master Actually Is
git rev-parse --abbrev-ref master@{upstream}
origin/master is a real, local bookmark for "where origin's master was, as of the last time we talked to it" — not a live view. That distinction becomes important the moment someone else pushes too.
A "remote" is genuinely just another Git repository git knows how to reach — over SSH, over HTTPS, or, as in this lab, over a plain filesystem path. GitHub itself is built on exactly this same real plumbing: a "bare" repository (no working directory, just the real Git data) that repositories push to and pull from.
This lab creates a genuine bare repository right on this machine and pushes to it for real — the exact same commands (git remote add, git push -u) you would use with any real host. Nothing here is simulated; it is the identical operation GitHub performs at a larger scale.
Bare repository
A real Git repository with no working directory — just the .git contents (objects, refs, config) directly at the top level. Confirmed directly in this lab: ls on the bare repo showed HEAD, objects, refs, and config, with no actual recipe files anywhere.
git push -u origin master
Pushes master's commits to the remote named origin, and (via -u) sets up tracking so future pushes on this branch need no arguments. Confirmed directly in this lab producing a genuine "branch 'master' set up to track 'origin/master'" confirmation.
origin/master
A real, local remote-tracking reference recording where origin's master branch was as of the last real communication with it — confirmed directly via git rev-parse. It updates only when you fetch or push, never on its own.
Takeaways
- A remote is genuinely just another reachable Git repository — a filesystem path, an SSH address, or an HTTPS URL, identical plumbing either way
- A bare repository holds real Git data with no working directory — exactly what GitHub's own servers run
- git push -u origin <branch> both sends commits and sets up tracking, needed only once per branch
- origin/master is a real, local record of where origin's master was last time you communicated with it