Lesson 09
Remotes
A remote is a saved name for another repository that your local project can exchange history with.
Visual Explanation
Ready to run git remote add origin https://gitlab.com/acme/shop.git.
Keep These Ideas
- Local repository
- The commits stored on your computer.
- Remote repository
- A separate shared copy, often hosted on GitLab or GitHub.
- origin
- A conventional nickname for a remote, not a special server.
The Real Command
Terminal
git remote add origin https://gitlab.com/acme/shop.gitThis saves the repository URL under the short name origin. It does not upload anything yet.
Command Details
git remote -v-v means verbose. It lists remote names together with their fetch and push URLs.
Example Output
origin https://gitlab.com/acme/shop.git (fetch)
origin https://gitlab.com/acme/shop.git (push)git remote get-url originget-url prints the saved address. Use it to verify where origin points.
Example Output
https://gitlab.com/acme/shop.gitKnowledge Check
Connect Local and Shared Repositories
Inspect remote addresses and understand what a remote name represents.
Question 1 of 5
- Question 1: current
- Question 2: not started
- Question 3: not started
- Question 4: not started
- Question 5: not started