Check changes between versions

The following command displays the history (logs) in a more compact format:

git log --pretty=oneline

On my computer, it produces the following output:

2116411a3bec83072de94fc354efe5fb8f493905 (HEAD -> main) Link to sleepyti.me URL
d0f33835f7910c5ed74708e2b7a2fa85211d50c0 Add description for this app
3d7292fd9530ce727fcf8323a4b2cc207d1e6ad5 Add README file

git diff

You can see the changes made from one to another commit, using the following syntax where <commit> is a commit ID. (The first commit ID is typically pointing to a commit made earlier than the second commit ID.)

git diff <commit> <commit>

The result will be the changes made between the first and second commits (identified by their IDs) in the form of a diff file.

For example, here is the diff between the latest commit (where I added a link to sleepti.me URL) and the one where I added a description for this app.

diff --git a/README.md b/README.md
index 9c6bd90..d9f16f3 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
 # SleepTime App
 
-A simple web application similar to sleepyti.me but limited to suggesting "wake up" times based on calculating sleep cycles.
+A simple web application similar to [sleepyti.me](https://sleepyti.me/) but limited to suggesting "wake up" times based on calculating sleep cycles.
 
 - A sleep cycle lasts about 90 minutes, and a good night's sleep consists of 5-6 sleep cycles.
 - If you wake up in the middle of a sleep cycle, you will feel groggy even if you've completed several cycles before waking up.

To better understand the diff format, consult this guideline.

The git diff command is a handy tool to quickly check the changes made since the last commit.

Example: Add the following sentence to the end of README.md

The SleepTime App is made using basic HTML, CSS, and JavaScript.

Save the file, and then run git diff in the terminal. Notice the newly added sentences is highlighted as an addition to the README.md file.