Working with GitHub — Module Recap
Module 05 is complete. Your local Git knowledge now extends to the internet — you can publish repositories, keep them in sync, and retrieve existing repositories onto any machine.
What you learned
Section titled “What you learned”Git vs GitHub — Git is local version control software. GitHub is a hosting platform for Git repositories. They are separate. Your local repo and GitHub repo are two independent copies, synced via push and pull.
Creating a repository on GitHub — Use the + icon on GitHub. Key decision: create an empty repo (no initialization options) when you already have local commits. Initialize on GitHub when starting fresh, then clone.
Connecting a local repo to GitHub — git remote add origin <url> registers the remote. git push -u origin main pushes your commits and sets the upstream tracking relationship. Authentication: HTTPS requires a Personal Access Token; SSH uses keys.
Pushing and pulling — git push sends your new commits to GitHub. git pull fetches and merges commits from GitHub. git fetch downloads without merging, letting you inspect before integrating. git status shows whether your branch is ahead, behind, or diverged from the remote.
Cloning — git clone <url> downloads a repository to your machine with origin pre-configured and the full history included. Use it when getting a repo onto a new machine or joining a team project.
Command reference
Section titled “Command reference”| Command | What it does |
|---|---|
git remote add origin <url> | Register a remote named origin |
git remote -v | List remotes and their URLs |
git push -u origin main | Push and set upstream tracking |
git push | Push current branch to its upstream |
git pull | Fetch and merge from upstream |
git pull --rebase | Fetch and rebase instead of merge |
git fetch | Download remote commits without merging |
git log main..origin/main --oneline | Show commits on remote not yet local |
git clone <url> | Clone a repository to this machine |
git clone <url> <dir> | Clone into a specific directory name |
git branch -a | List all branches including remote-tracking |
What’s next — Pull Requests and Collaboration
Section titled “What’s next — Pull Requests and Collaboration”Module 06 introduces the pull request workflow — the standard way teams propose, review, and merge changes on GitHub. You will learn to create feature branches, open pull requests, respond to review comments, and merge with confidence.
Pull requests are not a Git concept — they are a GitHub feature layered on top of Git branches. Understanding branches (Module 03) is the foundation for understanding pull requests.