Step 3
The following command displays the history (logs) in a more compact format:
git log --pretty=oneline
On my computer, it produces the following output:
28bca5f1424cdeba23624db9deae765e4c97d793 (HEAD -> master) Link to sleepyti.me URL
79cbc98629aa98b11003c48b5a3a4cf79c78f292 Add description for this app
f034c1ea747a6ab6726681d60a7bd5b097ff40b8 Create README file
You can see the changes made from one to another commit, using the following syntax
git diff <commit> <commit>
where <commit>
is a commit ID. (The first commit ID is typically pointing to a commit made earlier than the second commit ID.)
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 (Link to sleepyti.me URL
) and the one where I added a description for this app.
diff --git a/README.md b/README.md
index 5f67354..3e30459 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# SleepTime App
-A simple web application similar to [sleepyti.me](https://sleepyti.me/) but limited to suggesting "wake up" times based on calculating sleep cycles.
+A simple web application similar to 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.
\ No newline at end of file
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. This is the output on my computer:
diff --git a/README.md b/README.md
index 5f67354..f5b05c0 100644
--- a/README.md
+++ b/README.md
@@ -3,4 +3,6 @@
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.
+The SleepTime App is made using basic HTML, CSS, and JavaScript.