View Diff In Git Commit
git commit -v
When you commit using the -v
flag a diff of files that are staged is appended
to the end of the editor you use when writing commit messages. The best part is
this diff is not appended to the actual commit message!
Here is an example where I commited this blog post!
Add post about -v arg when commiting.
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch master
# Your branch is up to date with 'origin/master'.
#
# Changes to be committed:
# new file: site/content/blog/2019-01-31-view-diff-in-git-commit.md
#
# ------------------------ >8 ------------------------
# Do not modify or remove the line above.
# Everything below it will be ignored.
diff --git a/site/content/blog/2019-01-31-view-diff-in-git-commit.md b/site/content/blog/2019-01-31-view-diff-in-git-commit.md
new file mode 100644
index 0000000..40662f3
--- /dev/null
+++ b/site/content/blog/2019-01-31-view-diff-in-git-commit.md
@@ -0,0 +1,15 @@
+---
+date: 2019-01-31
+title: 'View Diff In Git Commit'
+description: 'Ever need to see a diff while building a commit message?'
+draft: false
+spoiler: 'Ever need to see a diff while building a commit message?'
+---
+
+```bash
+git commit -v
+```
+
+When you commit using the `-v` flag a diff of files that are staged is appended
+to the end of the editor you use when writing commit messages. The best part is
+this diff is not appended to the actual commit message!