# Matplotlib compatibility patch for Pyodide
import matplotlib
if not hasattr(matplotlib.RcParams, "_get"):
matplotlib.RcParams._get = dict.get
Exercise 5: Merge your version in the original book#
In Exercise 4: Your Version of the Book you created your own version of a book. But it would be a pity if you never contribute back to the original book right? Probably your additions are very useful there too! You’ll merge you version of the book which is stored on a branch into the original book which is on main. If there’ve been some changes on that main branch in the meantime, git will take care of that!
Go to your repository homepage. Probably, it will have big yellow announcement saying
1-<your_issue_title> had recent pushes <some> minutes ago - Compare & Pull request. We’ll ignore that for now and do it manually.Go to the pull request page on your repository homepage - and click
New pull requestOn make sure you point from your branch
1-<your_issue_title>intomain. So,mainon the left, , and1-<your_issue_title>on the right. Main is the default name for the branch which has the most recent/stable version. The page should now show all the changes you made on the1-<your_issue_title>-branch. If there would be changes on themainbranch in the meantime, they should show up here too.Click
Create pull requestto start the process of moving your changes into themainbranch. If there were changes on both branches which are conflicting, it will tell you there’s a merge conflict. If you followed the steps until now, that shouldn’t be the case. Solving those merge conflicts is topic for another exercise.Add a title and description described the changes you made. This is done to give other people a summary of what has been changed.
Assign yourself to make clear that you feel responsible.
Click
Create pull request. On the next page you’ll see that GitHub gives an announcement<your_username> linked an issue now that may be closed by this pull request. That sounds useful!As you’re the only one in this repo there’s nobody to review your work. So let’s continue and merge your changes into
mainby clickingMerge pull requestandConfirm merge(eventually specifying the suggested commit message and description)As this issue is now closed, you can safely remove the branch
1-<your_issue_title>as you don’t need it anymore. You can do so by clickingDelete branch.Go to
Actions- The most recent workflow runMerge pull request #2 from <your_username>/1-<your_issue_title> / the commit message of the commit you just made- Wait for it to finish - In the summary, click the link of the main branch or the primary book at root.Do you see your change from your branch 1-<your_issue_title>? If you don’t see it click
CTRL+F5/Control+F5to refresh the page. Check that the url indeed shows that you’re on main.
Check your understanding
Before moving on to the next exercise, make sure you understand the following:
What is the purpose of creating a pull request?
How do you manually create a pull request on GitHub?
Why is it important to add a title and description to your pull request?
What is the final step after merging your pull request?
How can you verify that your changes have been successfully merged into the main branch?