You’ve learned a lot about Git and GitHub. But, to become proficient with these tools takes a lot of repetition and practice. The exercises in this section ask you to repeat the process of finding an issue, fixing it and creating a pull request as you did in Chapter 3 Working Locally and Upstreaming Changes. This will give you more good practice. But also, the issue you will be fixing this time has been carefully planned as a setup for the next chapter too!
Before you get into the work of fixing a new issue, it will be helpful to review the steps that you’ll need to use and they were and how they fit together.
Clearly there are not enough “Round2” issues for everyone to have their own as was the case with the “Round1” issues. So, this time there will be multiple people working on the same issue.
Pick one of the “Round2” issues to work on and make a comment on it to indicate your interest in working on it. Note it is not necessary that the issue be assigned to you this time as it was in Round1. Try to spread out across the issues so that multiple people have commented that they are working on each one.
Now that you have an issue to work on, it is time to fix it. But before you actually start fixing the issue, let’s review some of the Git commands and a few other important ideas you’ll need to use to carry out the steps from Exercise 4.8.1.1.
When creating branches you should always use a name that describes what is being done in the branch, without being too long. This will help you to remember the purpose of the branch, but not make it onerous to type.
Which of the following would be the best commit message for the fix for issue 38 that adds a link to the GNOME Community Engagement Challenge in the acknowledgements?
Because there were a limited number of “Round2” issues, other students in your class will have worked on the same Round2 issue as you id. Thus, they will also have made pull requests that contain changes to the same line(s) in the README.md file as you did. The tasks below will ask you some questions about this situation.
Correct! While your PR changes the same lines of the README.md file as the other PRs, none of those PRs have been merged into the upstream main. Thus, your PR will not contain any conflicts with the upstream main branch.
GitHub will indicate that your PR cannot be merged automatically because it contains a conflict with the upstream main branch.
While your PR changes the same lines of the README.md file as the other PRs, none of those PRs have been merged into the upstream main. Thus, your PR will not contain any conflicts with the upstream main branch.
If your PR was the first one submitted for your Round2 issue, GitHub will indicate that it can be merged automatically, otherwise it will indicate that it cannot because there is a conflict with the upstream main.
The order in which the PR’s are created does not matter. A conflict will only arise after the changes in one of the PRs are merged into the upstream main. Thus, because no PRs have been merged there is no conflict between your PR and the upstream main at this point.
GitHub will indicate that your PR can be merged automatically because it does not contain conflicts with any of the other PRs that have been submitted for your Round2 issue.
Your PR and the others for your Round2 issue change the same lines, so in some sense your PR conflicts with the other PRs. However, none of them have been merged into the upstream main yet. Thus, there is no conflict between your PR and the upstream main at this point.
Hint.
Visit your PR in the upstream repo and see what GitHub tells you about whether it can be merged or not.
Your PR will have changed the same lines in README.md as the merged PR. The changes from the merged PR are now in the upstream main branch. Thus, your feature branch will now have conflicts with the upstream main branch and will not be able to be merged automatically.
GitHub will indicate that your PR cannot be merged automatically because it contains a conflict with the upstream main branch.
Correct! A PR for the Round2 issue you were working on has been merged into the upstream main. Your PR contained changes that changed the same lines of the README.md file as the merged PR. Thus, your PR will have conflicts with the upstream main branch and will not be able to be merged automatically.
If your PR for your Round2 issue was submitted before the other one was merged, GitHub will indicate that your PR can be merged automatically.
The order in which the PR’s are created does not matter. GitHub reevaluates whether there is a conflict each time you visit the PR page. Thus, because the other PR was merged, and it changed the same lines in README.md as your PR, your PR will now contain a conflict with the upstream main branch.
GitHub will indicate that your PR cannot be merged automatically because it contain conflicts with all of the other PRs that have been submitted for your Round2 issue.
Your PR will in some sense contain conflicts with all of the other PRs for the same Round2 issue. However, only the conflict with the upstream main branch matter here. That conflict was created when the other PR for your Round2 issue was merged.
Hint.
Visit your PR in the upstream repo and see what GitHub tells you about whether it can be merged or not.