Create your own
Lesson illustration

Reviewing and Integrating Changes with GitHub Issues and Pull Requests

Hello again. In the previous lesson, you resolved a merge conflict locally by treating Git’s conflict markers as a request for a deliberate decision, then verifying and committing the combined result.

This lesson moves that integration workflow onto GitHub. You will use an issue to define a small piece of work, open a pull request (PR) from a feature branch, inspect the diff, give or receive review feedback, and merge the reviewed work into main. The aim is to make the repository tell a trustworthy story: what problem existed, what changed, how it was checked, and why it was safe to integrate.


Issues, branches, and pull requests serve different purposes

These GitHub features are connected, but they are not interchangeable:

  • An issue records a problem, feature, task, or decision. It defines why work is needed and what “done” means.
  • A branch isolates the implementation work from main.
  • A pull request proposes combining one branch into another and provides a shared place to inspect the diff, discuss it, run automated checks, and record approval.

A pull request is therefore not merely a button that merges code. It is an integration conversation attached to an exact set of commits.

For a small video-library feature, the lifecycle might be:

  1. Issue: “Show the number of loaded videos in the success status.”
  2. Branch: feature/42-video-count-status
  3. Commits: implement and test the status change.
  4. PR: explain the behavior, link the issue, request review.
  5. Review: verify correctness, accessibility, and scope.
  6. Merge: integrate into main and automatically close the issue.

GitHub Issues are intended to track bugs, enhancements, and requests in a visible place. A useful issue is specific enough that another developer could implement it without guessing at the expected behavior.

Creating an issue - GitHub Docs

Read GitHub Docs’ “Creating an issue” for the repository-based workflow. Focus on the information GitHub lets you attach to a piece of planned work, not just the clicks.

In the section “Creating an issue from a repository,” follow the issue-creation workflow from step 1 through step 8. Notice where templates, labels, assignment, projects, and milestones fit; for this lesson, a clear title and description are the essentials.


Define work that can be reviewed

A vague issue such as “Improve video page” creates vague implementation and vague review. Instead, record observable behavior and constraints.

Create an issue in your project repository with a title such as:

Show loaded video count in the status message

Use a body like this, adapting it to the application you built earlier:

## Problem

After the video list loads, the interface confirms success but does not tell the user how many videos were loaded.

## Desired behavior

When a valid API response contains a video array, show an accessible success status such as:
"Loaded 12 videos."

## Acceptance criteria

- The count is derived from the validated video array.
- Loading and error feedback continue to work.
- The status message is exposed through the existing accessible status mechanism.
- `npm run build` succeeds.

The acceptance criteria are your initial review checklist. They turn “looks good” into claims that can be checked.

You may add a label such as enhancement, assign yourself, or add the issue to a project board if you use one. Those details help a team coordinate, but do not substitute for a meaningful issue description.

Record the issue number GitHub assigns—for example, #42.


From a branch to a reviewable pull request

Before beginning new work, synchronize your local main branch. The --ff-only flag avoids creating an unexpected merge commit during this routine update.

git switch main
git pull --ff-only origin main
git status

Create a branch whose name connects it to the issue:

git switch -c feature/42-video-count-status

Implement the narrow change described in the issue. If your current project already has fetched video data and an accessible status element, add the success count there. If you do not yet have that UI state available, use an equally narrow repository change—such as documenting the expected loading states in docs/video-list-behavior.md—but retain the same issue-to-PR workflow.

Test the change before asking anyone else to spend time reviewing it. For a UI change, this usually includes:

npm run build

Then use the browser to check a successful response, an empty list if your application supports one, and an error response. A reviewer should not be the first person to notice a broken build or an obvious regression.

Make a focused commit:

git status
git diff
git add src/main.js
git commit -m "Show loaded video count in status"
git push -u origin feature/42-video-count-status

If your change touches different files, replace src/main.js with the files you actually intend to commit. Re-read git diff --staged before committing; a PR is clearer when it contains only changes that implement its issue.

A PR has two directions:

  • base branch: where the work will go, normally main
  • compare branch: where the work currently lives, here feature/42-video-count-status

How to create a pull request in 4 min | GitHub for Beginners

Watch GitHub’s “How to create a pull request in 4 min | GitHub for Beginners.” It gives a compact visual view of how a pushed branch becomes a focused, reviewable PR.

Watch the PR model to distinguish the source branch from the destination branch. Then watch PR creation, including the base and compare selectors. Finish with three review habits: keep PRs small, self-review, and provide context.

On GitHub, use the Compare & pull request prompt that appears after your push, or open the repository’s Pull requests tab and choose New pull request. Confirm:

base: main  <-  compare: feature/42-video-count-status

A reversed direction is a common and costly mistake. Pause and inspect the diff before creating the PR.

Use a title that states the result:

Show loaded video count in status

For the description, include the linked issue, a compact summary, and your verification evidence:

Fixes #42

## What changed
- Added a success status that reports the number of loaded videos.
- Kept the existing loading and error states intact.

## Verification
- Ran `npm run build`
- Checked success, empty-list, and error behavior in the browser

Fixes #42, Closes #42, or Resolves #42 links the PR to the issue. When the PR is merged into the repository’s default branch, GitHub closes that linked issue automatically. A bare #42 creates a useful link but does not request automatic closure.


Review the change, not just the code

Before requesting a review, perform a self-review. Open the PR’s Files changed tab and read the diff as if it were written by someone else.

Check these questions:

  1. Scope — Does every changed file contribute to the issue? Is unrelated formatting or debugging output included?
  2. Behavior — Does the code actually satisfy the acceptance criteria?
  3. Failure paths — Does the new logic preserve loading, error, and empty-data behavior?
  4. Accessibility — Does an updated status reach the intended user, rather than relying only on a visual cue?
  5. Maintainability — Are names, conditions, and messages clear enough for a future change?
  6. Evidence — Are tests, build results, or manual verification recorded in the PR description?

A good review comment is specific, explains the impact, and distinguishes a blocking concern from an optional idea.

For example:

Request: Could the count be rendered only after confirming that the response data is an array? Otherwise a malformed successful response could produce an unclear status rather than entering the existing error path.

This is more useful than “Handle edge cases,” because it identifies the condition, the risk, and the desired direction.

For a small, exact edit, a reviewer can leave a GitHub suggestion. In a code comment, it looks like:

```suggestion
setStatus(`Loaded ${videos.length} videos.`);
```

GitHub can let the PR author apply such a suggestion as a commit. Even then, inspect the resulting change and rerun the relevant checks; applying a suggestion is a code change, not proof that the behavior is correct.

If you have a collaborator, use Reviewers in the PR sidebar to request their review. If you work alone, self-review is still worthwhile, but do not treat your own approval as independent validation. The GitHub Skills “Review pull requests” exercise from the supplied resources is a good later practice environment for the reviewer side of this workflow.


Finish a review deliberately

Inline comments can be submitted individually, or gathered as pending comments and submitted together as one coherent review. The latter is often better: the author receives a single set of prioritized feedback instead of a stream of disconnected notifications.

Finish your review GitHub’s “Finish your review” dialog lets a reviewer submit accumulated comments as general feedback, an approval, or a request for changes; “Abandon review” discards only the reviewer’s pending comments.

The dialog presents three meaningful review outcomes:

Review outcomeMeaningUse it when
CommentFeedback without an explicit merge decisionYou have questions, non-blocking suggestions, or need more context.
ApproveYou believe the PR is ready to mergeThe change meets its requirements and no blocking concern remains.
Request changesThe author must address identified concerns before mergeThe PR has a correctness, security, accessibility, test, or scope problem.

A “request changes” review is a strong communication signal. Whether it technically prevents merging depends on the repository’s branch-protection or ruleset configuration. Well-configured shared repositories often require approving reviews and passing checks before main can be updated.

If changes are requested, the author should:

  1. Read every comment and clarify uncertain intent before editing.

  2. Make the needed local changes on the same feature branch.

  3. Run the relevant build and tests.

  4. Commit and push the revision:

    git add src/main.js
    git commit -m "Handle invalid video list response"
    git push
    
  5. Reply to each conversation with what changed and why.

  6. Mark conversations resolved only when the concern is actually addressed.

  7. Re-request review if appropriate.

The existing PR updates automatically when you push to its source branch. Do not open a second PR for the review revision.


Merge with a history strategy

Once the PR is approved, checks are passing where configured, and every blocking conversation is resolved, merge it on GitHub.

GitHub may offer several merge methods, depending on repository settings.

GitHub’s pull-request merge menu shows the three common integration strategies: a merge commit preserves branch topology, squash creates one combined commit, and rebase replays the branch commits onto the base branch.
MethodResult in mainAppropriate use
Create a merge commitPreserves all feature commits and adds a merge commit connecting the historiesThe branch’s individual commits are meaningful and you want the branch structure visible.
Squash and mergeCombines the PR’s work into one new commitA small feature has several work-in-progress commits, but should appear as one coherent change in main.
Rebase and mergeReplays each feature commit on top of main, without a merge commitYou want a linear history and every individual commit is already clean and meaningful.

For this small feature, Squash and merge is usually a sensible choice if your branch has several intermediate commits. Edit the resulting commit message so it communicates the completed behavior, for example:

Show loaded video count in status (#42)

If a PR has a merge conflict—as you practiced last lesson—do not guess in the web interface merely to make the merge button available. Resolve it locally when practical, run your build and checks, push the resolution, then return to the PR.

After merging, GitHub will normally offer to delete the remote feature branch. Accept that offer once you are sure the change is integrated. Then update your local repository:

git switch main
git pull --ff-only origin main
git branch -d feature/42-video-count-status
git log --oneline --decorate -5

Finally, open the linked issue and confirm that GitHub closed it and that the PR link provides the implementation trail.


Wrap-up

A reliable GitHub workflow connects planning, implementation, review, and integration:

  • Use an issue to define the problem and acceptance criteria.
  • Create a focused feature branch and commit only related work.
  • Open a PR with the correct base and compare branches, clear context, and verification evidence.
  • Review the diff carefully; use comments, suggestions, approval, and requests for changes according to their meaning.
  • Merge only after blocking concerns are resolved and required checks are satisfied.
  • Delete the integrated branch, update local main, and let the merge close the linked issue.

You have now completed the collaborative Git workflow for this module: focused commits, branches, conflict resolution, and GitHub-based review and integration. Next, you will begin the React module by creating and running a React application with Vite and npm scripts.

Can't find a good explanation? Sign up and we'll make it for you

Sign up