LESSON 9
Remote Repositories
Learning objective: Connect a local repo to GitHub and push your code.
Understand
A remote links your local repo to GitHub.
Add a remote named origin pointing to your GitHub repo, then push your commits up. After that, git push sends new work and git pull brings down changes.
Analogy: Pushing is like uploading your latest save to the cloud.
See It in Action
Connecting and pushing:
git remote add origin https://github.com/you/repo.git
git push -u origin mainHow it works: The first line links your local repo to GitHub, and the push uploads your commits to the
main branch online.Try It Yourself
- Create an empty repo on GitHub.
- Add it as
origin. - Push your local commits.
Quick Quiz
What does git push do?
Challenge
Push a local project to a new GitHub repository.
Success condition: Your commits appear in the repository on GitHub.
+10 XP
Lesson Complete
You answered correctly and completed the required practice. Your progress has been saved on this device.
Continue to next lesson →