Join Medium for free to get updates from this writer.
Example:
git show shows the contents of the last commit.
$ git show
commit d9a8f7e92c3a4e7f8bca11d3a7d9c1f7f8231b7b (HEAD -> main) Author: Aragorn <strider@ranger.path> Date: Sat Oct 7 12:32:10 2024 -0400
Guided hobbits safely to Bree
- Established watch to catch unwanted behavior - Set up checkpoints to monitor entry points
diff --git a/security.rb b/security.rb index 3a1c8f2..d4e5f6a 100644 --- a/security.rb +++ b/security.rb @@ -12,7 +12,9 @@ class Security def establish_watch # Monitor for suspicious activity watchers << "ranger" - watchers << "elf" + watchers << "elf" unless location == "Bree" # Too conspicuous + watchers << "dunadan" if location == "Bree" # Blend in better + log "Watch established with #{watchers.count} members." end end
We can also use the SHA of the commit to show its diff — helpful for viewing earlier commits — or a branch name, to view the commit a specific branch is currently pointed to.