Exercises
-
In the
test.txtfile, add a new line with the textDefinitely the last change!. Add and create a commit with the change totest.txtwith the commit messagefinal changes to test.txtand push to GitHub. Check the GitHub website to ensure that your changes appear there. -
Create a new file in your
camp-1-GITHUB-USERNAMEdirectory calledfavorite-things.txt. Add text to this file to list a few of your favorite things (three is enough). Now, add an additional line of text to theREADME.mdthat saysDefinitely the last change!. Commit only the changes that you made toREADME.md. Usegit commitwithout the-mflag and use the text editor that Git opens for you to add a multi-line commit message that says:final changes to README.md Some more comments on an additional lineUse
git statusto confirm that you have added only the changes toREADME.mdbefore pushing the commit to GitHub. Check the GitHub website to see if you completed this excercise correctly. Hint: You should not see the new file that you created (favorite-things.txt) on GitHub. -
Add the new file
favorite-things.txtto a commit and push the file to GitHub. After confirming that the new file appears on GitHub, edit the file to add an additional line of text to include something that you dislike.Use Git to restore
favorite-things.txtto include only your favorite things. Usegit statusto confirm that you have not made any new changes tofavorite-things.txtsince your last commit. Hint: You should not need to editfavorite-things.txtin VSCode to restore the original text. -
Add your full name and CnetID to the top of
favorite-things.txt. Add these changes to a new commit but do not commit and push them just yet. After staging this last change to a commit, you realize that you forgot to include an additional update tofavorite-things.txt.Unstage
favorite-things.txt, add one more favorite thing to the list in the file, and then commit and push your changes to the remote repository. Usegit statusto confirm that there are no pending changes in your repository. Check GitHub to make sure thatfavorite-things.txtincludes all of your recent changes.