Chapter 12. Pull Requests (Merge Requests)

[ 12 ]

Pull Requests (Merge Requests)

Up until now, we have only covered how to integrate changes from one branch into another when working with a local repository.

In this chapter you are going to learn about pull requests, a helpful tool for collaboration that allows you to integrate changes from one branch into another in a remote repository. Along the way, you will also learn a handy trick for how to more easily define upstream branches for new local branches.

Additional resources to assist you as you work through this chapter are available in the Learning Git repository (https://github.com/gitlearningjourney/learning-git).

State of the Local and Remote Repositories

At the start of this chapter, you should have two local repositories called rainbow and friend-rainbow and one remote repository called rainbow-remote. All three of these repositories should be in sync, with the same commits and branches.

Visualize it 12-1 shows the state of the local and remote repositories in the Rainbow project with all the commits that were made from Chapter 1 to Chapter 11.

[ Visualize it 12-1 ]

figure

The Rainbow project at the start of Chapter 12 with all the commits since Chapter 1

To focus on the commits you are going to make in this chapter, from here on I will simplify the Visualize It diagrams and show only ...

Get Learning Git now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.