Skip to main content

GitKit (Linux Desktop Edition): Learn git and GitHub in Context

Section 4.1 Understanding Changes to the Upstream Repository

If the upstream maintainers decide that the changes in your PR (pull request) are good for the project, they will merge them into the upstream main branch. That way they become a part of the main project, and everyone can benefit from your work. In class your instructor played the role of an upstream maintainer and demonstrated how the changes contained in pull requests are merged.

Exercises

Figure 4.1.1 illustrates the state after several commits have been merged into upstream main.
Cloud image of the changes merged into upstream.
Figure 4.1.1. Changes Merged into Upstream.

1.

Answer the following questions using Figure 4.1.1
(a)
    Which commits (give the colors) were merged into the upstream main since the contributor created the feature branch that is shown?
  • Red
  • Yellow
  • Green
  • Blue
  • Pink
  • Lime Green
Hint.
Look at which commits are new in upstream that are not part of the local repository’s main or feature branch.
(b)
    Which of the commits did the managers merge from the contributor’s pull request?
  • Red
  • Red was in main prior to the contributor creating the feature branch.
  • Yellow
  • Yellow was in main prior to the contributor creating the feature branch.
  • Green
  • Green was in main prior to the contributor creating the feature branch.
  • Blue
  • Blue was part of the contributor’s feature branch.
  • Pink
  • Pink was part of another contributor’s pull request.
  • Lime Green
  • Lime green was part of another contributor’s pull request.
Hint.
Look at which commits are in the local repository’s feature branch.
(c)
Briefly explain how the pink commit could have gotten into the upstream main.

2.

GitHub will inform you when the active branch in your origin repo is out of synch with the upstream.
(a)
Use your browser to visit your origin repo on GitHub and ensure that the main branch is selected. Find the part of the page that indicates that your main branch is behind (i.e. not the same as, or out of synch with) the upstream main.
(b)
Briefly explain what has happened that caused your origin’s main branch to get behind the upstream main.
You have attempted of activities on this page.