git remote
Manage the bookmarks that point at other repositories.
git remoteWhat it does
git remote is a thin config manager: it lists, adds, renames and removes remote bookmarks. Each remote is just a name → URL mapping stored in .git/config. The commands git fetch, pull and push all read that mapping when you say 'origin'.
Your machine
local repository
Remote origin
everything.git
git remote wires origin in the config — the bookmark for the outside world
Watch it — press play
A narrated, step-by-step walkthrough that shows how to do it — not just theory. It adapts to the learner mode you picked in the top bar.
Step 1
Bookmark another repo
A remote is just a name → URL note. No network happens until you fetch or push.
git remote add origin git@github.com:user/repo.gitYour machine
local repository
Remote origin
everything.git
git remote add links a name to a URL
Under the hood
A remote is two lines of config
git remote add origin <url> writes a section into .git/config. Nothing is transferred, no network happens — it's a bookmark.
[remote "origin"] url = git@github.com:user/repo.git fetch = +refs/heads/*:refs/remotes/origin/*
Fetch lines become remote-tracking refs
The fetch refspec says 'take remote heads and store them locally under refs/remotes/origin/'. That's why `git fetch` later creates local read-only copies of every remote branch.
Command anatomy
addBookmark a new repository.
-vList remotes with their fetch/push URLs.
removeDelete a bookmark (doesn't touch the remote repo).
renameChange a remote's name.
set-urlRepoint a remote's URL (e.g. HTTPS → SSH).
When to reach for it
Forking workflow: add an upstream remote pointing at the original repo.
Switching from HTTPS to SSH auth: git remote set-url origin git@….
Checking where 'origin' actually lives before pushing somewhere sensitive.
Practice
A real repo, pre-seeded with history, runs right here — stage, commit, branch, stash, diff, even hit and resolve a real merge conflict. Nothing to install, nothing leaves your machine.
Open practice playground