Skip to main content

GitHub: Your Code, Online

beginner16 min readLesson 48 of 143

Push your repository to GitHub so it is backed up, shareable, and open for collaboration — the remote in every developer's workflow.

Git is local; GitHub hosts Git repositories online. The online copy is called a remote. Publishing your repo gives you backup, a portfolio, and collaboration — every job application you will ever make starts with a link to your GitHub.

Connect and push

After creating an empty repo on github.com (the site shows you these exact commands):

git remote add origin https://github.com/ada/my-site.git
git push -u origin main
  • origin is the conventional nickname for your remote
  • push uploads commits; -u remembers the pairing so future pushes are just git push

The daily cycle with a remote

git pull            # fetch + merge anything new from the remote
...work, add, commit...
git push            # share your commits

clone is the reverse of remote-add: it downloads an existing repo with its full history — git clone <url> is how you join any project.

README, issues, pull requests

  • README.md — the repo's front page: what it is, how to run it
  • Issues — a to-do list of bugs and ideas
  • Pull request (PR) — "please merge my branch": the review-and-discussion step every team uses. On your own repos, open PRs to yourself for practice; reading diffs is a skill worth building early.

What you learned

  • A remote is your repo hosted online; origin by convention
  • push uploads, pull downloads, clone starts fresh
  • README, issues, and PRs are how real projects communicate

Next: putting a real site on the internet — GitHub Pages.

Now practice

GitHub: Your Code, Online — PracticeHands-on practice for “GitHub: Your Code, Online”: apply what you just learned in github-remote.1 challenge · · ~10 min