Skip to main content

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

Section 5.6 Updating Your Pull Request

At this point you have resolved the merge conflict and committed the changes to the feature branch in your local repository. What is left is to push that branch to your origin. When you do so, GitHub will automatically update your pull request to the upstream for that branch.

Exercises

1.

Give the command that will push your modified feature branch to your origin.
Hint.
Section 3.7 Pushing a Branch to Your Origin introduced the command for pushing a feature branch to your origin.

2.

(b)
Which of the following pieces of information appear in the terminal output from your command?
  • The URL of your origin repository.
  • The URL of the upstream repository.
  • The name of the file that was changed.
  • The name of the feature branch that you pushed.
  • A bunch of information about "objects".
  • None of these.
Hint.
Look closely at the output from your command in the terminal.

3.

Now that you’ve resolved the merge conflict and pushed the result to GitHub, it should be possible for the maintainers to automatically merge your pull request. Let’s check!
(a)
Visit the upstream repo on GitHub, click on the "Pull requests" tab.
(b)
Find and click on your Round2 pull request.
(c)
Scroll down toward the bottom of the pull request.
(d)
Which of the following messages do you see?
  • GitHub message indicating that merging can be performed automatically.🔗
    Image of a dialog with a green checkmark and the message "This branch has no conflicts with the base branch. Merging can be performed automatically."
  • Correct! You successfully resolved the merge conflict! Please continue to the next exercise.
  • GitHub message indicating that there are merge conflicts that must be resolved.🔗
    Image of a dialog with a exclamation point inside a triangle and the message "This branch has conflicts that must be resolved. Use the web editor or the command line to resolve conflicts."
  • Uh oh! Something didn’t work. Let’s try to fix it.
    1. Run the command git revert --hard HEAD~1
    2. Go back to Subsection 5.4.2 The git merge Command., merge main into your feature branch and try again to resolve the conflict.
  • I don’t see either of the other messages.
  • If you see a message about GitHub checking if the merge can be performed automatically, wait a few moments for one of the other messages to appear.
Hint.
Make sure you have fixed the conflict, pushed your updated branch, and that the pull request has been updated.
You have attempted 1 of 3 activities on this page.