2.3 GitHub Collaboration: Issues and Pull Requests
Git is the version control tool. GitHub is an online collaboration platform around Git repositories. You can think of GitHub as: remote repository + discussion space + code review + project management.
Issue: describe the problem first
An Issue usually records a task, bug, idea, or discussion. For example:
Title: Login button wraps on mobile
Observed:
- On iPhone width, the Google sign-in button text wraps to two lines.
Expected:
- Button height stays stable and text does not overflow.
Possible location:
- frontend/app/[locale]/account/page.tsxA good Issue does not only say "there is a bug." It explains the behavior, the expected result, and the likely area.
Pull Request: ask to merge your branch
A Pull Request, usually called a PR, means "please review and merge my branch." A common flow is:
git switch -c fix/mobile-login-button
# edit code
git add .
git commit -m "Fix mobile login button layout"
git push -u origin fix/mobile-login-buttonThen create a PR on GitHub to merge fix/mobile-login-button into main.
Review: code review
On a PR page, teammates can:
- Inspect changed files.
- Leave comments on specific lines.
- Request changes.
- Approve the merge.
Code review is not about being picky. It catches problems before merging, shares context, and protects the main branch quality.
Merge: merge the PR
After approval, the PR can be merged into main. Common merge strategies include:
- Merge commit: keeps the visible branch merge.
- Squash merge: compresses many PR commits into one commit.
- Rebase merge: places commits after main for a more linear history.