Exercises
-
In the
test.txt
file, add a new line with the textDefinitely the last change!
. Add and create a commit with the change totest.txt
with the commit messagefinal changes to test.txt
and push to GitHub. Check the GitHub website to ensure that your changes appear there. -
Create a new file in your
camp-1-GITHUB-USERNAME
directory 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.md
that saysDefinitely the last change!
. Commit only the changes that you made toREADME.md
. Usegit commit
without the-m
flag 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 line
Use
git status
to confirm that you have added only the changes toREADME.md
before 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.txt
to 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.txt
to include only your favorite things. Usegit status
to confirm that you have not made any new changes tofavorite-things.txt
since your last commit. Hint: You should not need to editfavorite-things.txt
in 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 status
to confirm that there are no pending changes in your repository. Check GitHub to make sure thatfavorite-things.txt
includes all of your recent changes.