Your First Push

A real remote — even a local one works exactly like GitHub underneath. Push to it for real.

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.\n\nThis 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.

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.

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.

📦 Create a Genuine Bare Remote

Initialize a real bare repository right next to your project — this stands in for GitHub, using the exact same underlying format.

cd ~/recipes && git init --bare --initial-branch=master ../recipes-origin.git
cd ~/recipes && ls ../recipes-origin.git

student@lab:~$ cd ~/recipes && git init --bare --initial-branch=master ../recipes-origin.git Initialized empty Git repository in /home/student/recipes-origin.git/ student@lab:~$ cd ~/recipes && ls ../recipes-origin.git HEAD branches config description hooks info objects refs

🔌 Register It as origin

Add the real remote under its conventional name and verify both directions.

cd ~/recipes && git remote add origin ../recipes-origin.git
cd ~/recipes && git remote -v

student@lab:~$ cd ~/recipes && git remote add origin ../recipes-origin.git student@lab:~$ cd ~/recipes && git remote -v origin ../recipes-origin.git (fetch) origin ../recipes-origin.git (push)

🚀 Push for the First Time

Send your entire real history to the remote, and set up tracking in the same step.

cd ~/recipes && git push -u origin master

student@lab:~$ cd ~/recipes && git push -u origin master Enumerating objects: 70, done. Counting objects: 100% (70/70), done. Compressing objects: 100% (66/66), done. Writing objects: 100% (70/70), 6.45 KiB | 49.00 KiB/s, done. Total 70 (delta 30), reused 0 (delta 0), pack-reused 0 To ../recipes-origin.git * [new branch] master -> master branch 'master' set up to track 'origin/master'.

🔍 Confirm the Real Tracking Relationship

Verify master's upstream and see the pushed history exactly as it now exists on the remote.

cd ~/recipes && git rev-parse --abbrev-ref master@{upstream}
cd ~/recipes && git log --oneline -3

student@lab:~$ cd ~/recipes && git rev-parse --abbrev-ref master@{upstream} origin/master student@lab:~$ cd ~/recipes && git log --oneline -3 dfca8a1 (HEAD -> master, origin/master) Stop tracking db-credentials.txt bd7db64 Add database credentials a980dbd Add .gitignore for local clutter and secrets

Lab 1.5.3 complete. A genuinely real remote, created and pushed to for real:\n\n\n Bare repository created : ✅ real Git data, no working dir\n Registered as origin : ✅ confirmed via remote -v\n Pushed with -u : ✅ full real history sent\n Tracking confirmed : ✅ master → origin/master\n

Enable JavaScript to run the live terminal and track your progress.