

Usually it is simple: just look at both versions and choose one, or the other, or come up with some happy medium.
Git pull request how to#
So a merge conflict requires a human to figure out how to resolve it. During this time, conceivably many new commits have been added to the master branch and somewhere there is an unfortunate overlap with the contributor's edits or their context. The contributor added commits at a leisurely pace, and the overlords took their time in getting to their pull requests (always a bad practice for an overlord, you want happy contributors!). It was created as a branch off the tip of master, but that was a long time ago.

Should the second group of exercises go before the first addition, or after the first addition? git cannot help you here, and therefore will not help you.Īnother likely explanation is that the pull request has a branch with a long lifetime. Once you accept one of these pull requests, there is no automated way to determine where to put the second set of new exercises. (In the unlikely case that both people use the exact same wording then there would not be a merge conflict.) Another common scenario is when two people add new exercises to the end of an existing list. If they both submit pull requests, and you accept one of the pull requests, then the other pull request will cause a merge conflict because there is no automated way to figure out how to apply the second set changes since the original context has been destroyed by the application of the first pull request. This could happen, for example, if a definition had awkward wording, and two people decided to fix it at about the same time. What does that mean? A merge conflict occurs when two people modify the same part of the same file.

Let us assume the contributor gave a clear description, and what they describe sounds like something beneficial to your project.īelow the description you should see a check mark in a green disk, and the phrase This branch has no conflicts with the base branch If the contributor did a good job, there will be a few sentences describing what they did, and an indication of how their proposed changes appear in the final product, such as “New exercises for Chapter 6, see page 88.”. Each pull request will have a title, and it will tell you who made the pull request and when they created it. For Issues and Pull requests there will be a little number telling you how many items need your attention. The first three and the last one are used most often.
Git pull request code#
It is common to see seven tabs across the top of the repository on GitHub: Code Issues Pull requests Wiki Pulse Graphs Settings You have your manager-hat on now, not your contributor-hat. Note that you are going to the definitive repository, not your own personal fork of the project. Go to the project's home on GitHub and see if there are any pending pull requests. But you also need to know how to find any given pull request later. GitHub has likely sent you a notification immediately after a contributor has created a pull request, and maybe that email has a link to take you directly there. Here is an annotated description of the process of reviewing and accepting a GitHub pull request. The pull request is GitHub's way of letting other people contribute to your project, while still allowing you to have complete control.

Other people want to contribute to your project, so they create pull requests that GitHub notifies you about. In other words, you are an overlord now, with responsibility for the official version that will be produced from the definitive repository. We now change our point-of-view, to assume that you, dear reader, are the owner of the definitive repository, or have control over a definitive repository. Section 4.2 Reviewing and Accepting a Pull Request
