GitHub: Remote Repos & Pull Requests
GitHub is where your code lives online. Pull Requests (PRs) are how teams review and merge code safely.
Connecting to GitHub
# Push existing repo to GitHub
git remote add origin https://github.com/you/repo.git
git branch -M main
git push -u origin main
# Clone an existing repo
git clone https://github.com/you/repo.git
cd repo
The Pull Request process
- Push your branch to GitHub
- GitHub shows "Compare & pull request" button, click it
- Write a description: what changed and why
- Request reviewers
- Reviewers comment β you push more commits to address feedback
- Approved β Merge PR β Delete branch
GitHub features to know
- Issues, bug reports, feature requests, tasks
- Actions. Automated CI/CD (run tests on every push)
- Pages, free static site hosting from a repo
- Releases, tag versions of your software
- Fork, copy someone's repo to your account to contribute to open source
Resolve conflicts on your own branch, where a mistake costs nothing, instead of inside the merge everyone is waiting on.