What is a Pull Request?

A Pull Request, commonly called a PR, is a request to merge changes from one branch into another branch.

In our workflow, a feature branch contains the new work, and the Pull Request proposes merging that work into main.

GitHub Pull Request interface showing branch selection

GitHub’s Compare & pull request action starts the Pull Request process for a feature branch.

What to look for

When you open a Pull Request, GitHub shows the branch containing your changes and the branch that will receive those changes.

In our workflow, the feature branch is the branch being proposed, while main is the production branch that will receive the changes if the Pull Request is merged.

Think of it this way

You are not asking Git to automatically change main. You are opening a review page that says: “Here are my changes. Please review them before they become part of main.”

01Feature branchContains the completed feature.
02Pull RequestProposes merging the changes.
03mainReceives the changes after the PR is merged.

Create a Pull Request

After pushing the feature branch to GitHub, open the repository and start the Pull Request process.

GitHub will open a Pull Request form where you can confirm the branches, describe the changes, and submit the request for review.

GitHub Create Pull Request form

The GitHub Pull Request form is where you review the proposed change, select the branches, and provide information about the Pull Request.

What to look for

Before creating the Pull Request, check that the feature branch contains the changes you actually want to merge.

Also verify that the Pull Request is targeting the correct base branch.

Pull Request description

Use the title and description to explain what you changed, why you changed it, and anything that someone reviewing the change should know.

Before you click Create Pull Request

Confirm the direction of the Pull Request: your feature branch should be proposed for merging into main.

Base vs compare

When creating a Pull Request, GitHub asks you to select the branches involved in the comparison.

GitHub Pull Request base and compare branch selection

GitHub uses the base branch as the destination and the compare branch as the source of the proposed changes.

The easiest way to remember

Base is where the changes are going.

Compare is where the changes are coming from.

FieldBranchMeaning
BasemainThe branch that will receive the changes.
Comparefeature/homepageThe branch containing the proposed changes.
Check the direction

For our normal workflow, the direction should be:

feature/homepage → main

If the branches are reversed, GitHub will show a different set of proposed changes.

Review changes

GitHub shows the changes included in the Pull Request so they can be inspected before the branches are merged.

GitHub Pull Request Files changed view showing code differences

The Files changed view shows the actual differences introduced by the Pull Request.

What to look for

Look at the files and lines that changed. Added lines and removed lines are displayed so you can understand exactly what the Pull Request will introduce.

Review areas such as:

AreaWhat to inspect
FilesConfirm the expected files were changed.
Code

Check the implementation and remove unintended changes.

CommitsReview the commit history for the feature.
DescriptionConfirm the Pull Request explains the change clearly.
Review before merging

The goal of this step is to make sure the Pull Request contains the changes you actually intend to merge into main.

Check the deployment

Before merging the Pull Request, check whether the project’s automated checks and preview deployment have completed successfully.

GitHub Pull Request checks and deployment status

GitHub can display checks and deployment information associated with a Pull Request.

What to look for

Check whether the required checks have completed successfully and whether the preview deployment is available for testing.

If a preview deployment is available, open it and test the feature before merging it into main.

01Pull RequestChanges are proposed for main.
02ChecksAutomated checks and deployments run.
03PreviewTest the proposed version of the website.
Before merging

Do not treat a Pull Request as ready simply because it exists. Review the changes, check the deployment, and test the preview before merging.

Merge the Pull Request

Once the changes have been reviewed, tested, and the required checks have completed, the Pull Request can be merged into main.

GitHub Merge pull request interface

The GitHub Pull Request page provides the merge action after the required review and checks are complete.

What happens when you merge?

The changes from the feature branch become part of the main branch.

feature/homepage
      ↓
     main
Important

Merging into main is the point where the feature becomes part of the production branch. Make sure the changes are ready before completing the merge.

What happens next?

After the Pull Request is merged, Cloudflare Pages can detect the new commit on main and start the production deployment process.

Delete the feature branch

After a Pull Request has been merged, the completed feature branch may no longer be needed.

GitHub option to delete a feature branch after merging a Pull Request

After a Pull Request is merged, GitHub can provide an option to delete the remote feature branch.

Why delete it?

Feature branches are normally temporary. Once their work has been merged into main, removing the old branch keeps the repository easier to manage.

The local branch can also be removed when it is no longer required.

git switch main
git branch -d feature/homepage
Note

Deleting a feature branch does not delete the changes that were already merged into main.

Keep main

Do not delete the main branch. It is the production branch in our PageDeploy workflow.

Support PageDeploy with a coffee