Lesson 5 of 5
Collaboration with Pull Requests
Working Together on GitHub
A pull request (often shortened to PR) is GitHub's way of proposing changes. Instead of merging directly, you ask the team to review your work first.
The Pull Request Workflow
- Create a new branch for your feature or fix.
- Commit your changes on that branch.
- Push the branch to GitHub.
- Open a pull request that proposes merging your branch into
main. - Teammates review the code, leave comments, and request changes if needed.
- Once approved, the pull request is merged.
git switch -c fix-footer-links
git add footer.html
git commit -m "Fix broken links in the footer"
git push -u origin fix-footer-linksAfter this push, GitHub shows a button to open a pull request from the fix-footer-links branch.
Why Pull Requests Are Valuable
- Code review — another person can catch mistakes before they reach
main. - Discussion — the PR keeps a written record of why a change was made.
- Quality — automated tests can run on the PR before merging.
Forking a Repository
A fork is your own personal copy of someone else's repository on GitHub. Forking is how you contribute to open-source projects you do not have write access to.
- Fork the project to your own GitHub account.
- Clone your fork to your computer.
- Make changes on a branch and push them to your fork.
- Open a pull request from your fork back to the original project.
Issues
GitHub issues are used to report bugs, request features, and track tasks. A pull request can be linked to an issue so the issue closes automatically when the PR is merged.
Good Collaboration Habits
- Keep each pull request small and focused on one change.
- Write a clear description of what the PR does and why.
- Pull from
mainoften to avoid large conflicts. - Respond politely and promptly to review comments.
The pull request workflow is the standard way professional teams build software together. Practising it now prepares you for real development jobs.
Discussion
0No comments yet — be the first to leave one!