Skip to main content

GitKit (2nd ed.): Learn git and GitHub in Context

Section 5.3 Synchronizing with the Upstream Repository

From the previous section you know that there is a merge conflict between the upstream main branch and your feature branch. Before you can resolve this conflict you will need to get the changes from the upstream main branch into your local and origin main branches.
The process you learned for synchronizing with the upstream in Chapter 4 (Section 4.4 and Section 4.5) will copy the changes in the upstream main branch into your local and origin main branches. This process is illustrated in Figure 5.3.1.
described in detail following the image
Using pull and push to synchronize the local and origin main branches with the upstream main branch.
Figure 5.3.1. Synchronizing with the upstream.
The exercises in the remainder of this section will help you to synchronize your local and origin main branches with the upstream main branch.

Exercises

1.

To do the synchronization you’ll need to have your development environment running.
Click here to open your development environment
 1 
codespaces.new/HFOSSedu/KitClient-Codespace?quickstart=1
.
Please be patient as this can take a few minutes. When the development environment is ready you will see the message "Kit development environment is ready for use." and your browser window will look similar to the following:
The GitKit Development Environment.  The development environment is ready when you see the "Kit development environment is ready for use" message.

2.

(a)
Assuming your feature branch is currently the active branch, arrange the the commands below into the order they would be used to synchronize your main branches with the upstream main branch. Note: Not all commands will be used.
Hint.
Review Section 4.4 and Section 4.5 for how to synchronize with the upstream main.
(c)
    Let’s, confirm that your origin main branch is now synchronized with the upstream main branch.
    Visit your origin repository and ensure that the main branch is active.
    Near the top of the page, you should see a message that is similar to one of the following. Select the message that is most similar to what you see.
  • This branch is up to date with <the upstream>.
  • Excellent. Just as it should be. Continue on to the next exercise.
  • This branch xx commits behind <the upstream>.
  • Uh Oh. It doesn’t look like your synchronization worked. Try running the commands from Task 5.3.2.a again.
You have attempted 1 of 3 activities on this page.