Add A Remote
Part of the Version Control section of Coddy's Terminal journey — lesson 47 of 58.
To register a remote in your repo, use git remote add with a name and a URL:
git remote add origin https://github.com/you/project.gitThis stores the mapping inside .git/config. From now on, commands like git push origin or git fetch origin know which URL to talk to.
You can list remotes (and their URLs) at any time with:
git remote -vThe -v stands for verbose. Without it, git remote just prints the names. With it, you see fetch and push URLs side by side.
For most simple setups the fetch and push URLs are the same.
Challenge
BeginnerThe folder is a fresh repo. Add a remote called origin pointing to https://github.com/coddy/demo.git.
Then run git remote -v.
Cheat sheet
Add a remote with a name and URL:
git remote add origin https://github.com/you/project.gitList remotes and their URLs:
git remote -vTry it yourself
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Version Control
2Getting Started
Initialize A RepositoryThe .git FolderConfigure Your IdentityGit StatusRecap - First Repo8Merging
What Is A MergeFast-Forward MergeThree-Way MergeMerge ConflictsResolve A ConflictRecap - Merge Master11Feature Branch Project
Project OverviewInitialize Main3Tracking Changes
The Staging AreaGit AddGit CommitModifying A Tracked FileGit LogRecap - First Commits6Recipe Site Project
Project OverviewInitialize And Ignore