Skip to content

Latest commit

 

History

History
44 lines (22 loc) · 1.97 KB

README.md

File metadata and controls

44 lines (22 loc) · 1.97 KB

Git challenge - Part 2

Instructions

In this lesson we've seen how to undo changes / commits so we will now do some exercises to test these new skills.

Start by cloning this repository on your local machine and pushing it to a new repository on your github account.

Follow the instructions given below and once you are done, create a PR from feature-a to main. In the comments of this PR add the answers to the questions asked below (for example: "1.c- your answer"). Then copy the URL of this PR into the box provided on the learning platform.

All code changes must be made to the index.html file.

What you need to do

  1. Create a new branch feature-a

    a. Create a commit updating the user's personal data with your own data. (Please name your commit message as commit 1)

    b. Create another commit updating the text of the footer. (Please name your commit message as commit 2)

    c. Undo your last commit. What command would you use and why?

    d. Push your changes.

  2. a. Change anything from index.html and commit. (Please name your commit message as commit 3)

    b. Change another thing from the index.html and commit. (Please name your commit message as commit 4)

    c. You have realized that you introduced a bug with your commit 1 so you want to undo the entire commit. What command would you use and why?.

  3. a. Change anything from the index.html and commit. (Please name your commit message as commit 5)

    b. After examining your previous commit, you realized you made a typo in one word so you want to undo your last commit without losing the changes, fix the typo and re commit. What command would you use and why?

  4. Push everything and merge your branch to main.

  5. Now you need to undo your commit 3. Remember that all your previous commits are now part of the main branch which is shared with all your coworkers so you should be aware of the command you will use here. What command would you use and why?