Skip to main content

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

Section 5.10 Appendix A

Skip this section if you were not directed here from Exercise 5.2.4.
If you were directed here from Exercise 5.2.4, then the pull request you created for your Round2 issue is showing that it can be merged automatically. The most common reason that this happens is that you synchronized your local and origin main branches after the instructor merged the conflicting changes into the upstream main branch. This could have happened if you did not complete the previous assignment on time. The instructions in this section will help you to resolve that issue but will require a little additional work on your part.

Exercises

1.

Ensure that you are in your local repository in a Terminal. Use the following commands to restore your main branch to the state before the conflicts were introduced:
  • git switch main
  • git reset --hard~1
You should see output similar to:
  • HEAD is now at …

2.

You will now need to repeat the steps you used to fix your Round2 issue:
  • make a new feature branch
  • switch to your feature branch
  • make the changes necessary to address your Round2 issue
  • stage and commit your changes to your feature branch
  • Push your feature branch to your origin
  • Make a pull request to the upstream for your new feature branch
    • When you look at this pull request it should indicate that it cannot be merged automatically.
You have attempted of activities on this page.