Git Pull Requests and Merging

Plan, build, and merge Pull Requests using a professional GitHub workflow.

Project work by Sean Fitzgerald on NextWork.

Project Overview: Collaborating with Pull Requests

What this project is about

By the end of this project, you'll have: Two closed GitHub Issues linked to merged Pull Requests showing a professional workflow history. A merged PR using the default merge commit strategy that preserves full branch history. A second merged PR using squash merge to condense multiple commits into one clean entry. Secret Mission: A reusable Pull Request template that auto-populates every future PR in your repo.

Planning Work with GitHub Issues

Syncing the repo and creating an Issue

In this step, you'll sync your local repository and create your first GitHub Issue to plan a new feature. Issues are how teams track planned work, bugs, and feature requests.

Issue number and planned feature

My Issue number is #1

Building a Feature Branch and Opening a Pull Request

Creating the branch and PR

In this step, I’m creating a GitHub issue to clearly describe the change I want to make. Then I’ll create a feature branch connected to that issue, add a Resources section to my learning log, commit and push the changes, and open a pull request so the work can be reviewed before it is merged into the main branch.

Linking the PR to the Issue

I added Closes #1 to the pull request description to connect the PR to the original issue. This matters because it keeps the change and its purpose linked together, makes the work easier to track, and automatically closes the issue once the pull request is merged.

Merging with a Merge Commit and Syncing Locally

Merging and pulling changes

In this step, I’m merging the completed feature branch into the main branch so the new Resources section becomes part of the official project. After the merge, I’ll update my local main branch and delete the old feature branch locally and on GitHub to keep the repository clean and organized.

Merge strategy and auto-closing the Issue

I merged the pull request using the Create a merge commit strategy, which kept the feature branch’s commit history and added a separate merge commit to main. After the merge, Issue #1 closed automatically because I included Closes #1 in the pull request description.

Squash Merging a Second Feature Branch

Creating the second Issue and branch

In this step, you'll repeat the cycle with one key difference. Instead of a merge commit that preserves every individual commit from your branch, you'll use squash merge to condense all your feature branch commits into a single clean entry on main.

Explore this project