Skip to main content

GitKit (VSCode Edition): Learn git and GitHub in Context

Section 5.6 Extra Practice

This section is optional but will provide you with more practice with Git, GitHub and with resolving merge conflicts if you would like it.

Exercises

1.

    The upstream repository contains a branch created just for this practice. Use the following command to get this feature branch from the upstream into your local repo:
    • git fetch upstream merge-conflict-practice
    The merge-conflict-practice branch was created so that it contains some conflicts with the upstream main branch. When you have fetched this branch, think of it as if you had created it from main, then made some changes that resulted in conflicts with the upstream main branch. This leaves you at the point where you are trying to merge main into this feature branch and resolve the conflicts (e.g. like in Figure 5.4.1).
  • I have fetched the branch
  • I have not fetched the branch
  • Do not make continue until you have the merge-conflict-practice branch set up.

2.

Make the merge-conflict-practice branch active and try to merge main into it. Give the commands that you used and their output here.

3.

    The merge-conflict-practice branch contains a few conflicts so the merge you attempted in Exercise 5.6.2 should fail. Resolve the conflicts by accepting the changes from the merge-conflict-practice branch and all of the non-conflicting changes from the main branch.
  • I have resolved the conflicts
  • I have not resolved the conflicts
  • Do not make continue until you resolve the conflicts.

4.

Save your changes and commit them to resolve the conflicts to your feature branch. Be sure to use a meaningful commit message. Give the commands that you used and their output here.

5.

Push the merge-conflict-practice branch to your origin and create a pull request to the upstream. Give a link to your pull request.
You have attempted of activities on this page.