aboutsummaryrefslogtreecommitdiff
path: root/source/blog/2015-12-08-safeguarding-git-repos-against-accidental-rm.md
diff options
context:
space:
mode:
authorZhiming Wang <zmwangx@gmail.com>2016-01-08 11:21:54 -0800
committerZhiming Wang <zmwangx@gmail.com>2016-01-08 11:21:54 -0800
commit6053d313ce3abe876c7d05574effab438ce5e410 (patch)
tree0ff96b8118d625e57123a42e6582b9f0e0575583 /source/blog/2015-12-08-safeguarding-git-repos-against-accidental-rm.md
parentd484ca3946753a6dda8f37bb3a2529fc06294fc5 (diff)
downloadmy_new_personal_website-6053d313ce3abe876c7d05574effab438ce5e410.tar.xz
my_new_personal_website-6053d313ce3abe876c7d05574effab438ce5e410.zip
Markdown source files: Use ... to end YAML metadata block
Also add a newline after the metadata block. ... is easier on markdown-mode; if --- is used, the line immediately above it will be treated as a setext header and highlighted, which isn't so easy on the eyes.
Diffstat (limited to 'source/blog/2015-12-08-safeguarding-git-repos-against-accidental-rm.md')
-rw-r--r--source/blog/2015-12-08-safeguarding-git-repos-against-accidental-rm.md3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blog/2015-12-08-safeguarding-git-repos-against-accidental-rm.md b/source/blog/2015-12-08-safeguarding-git-repos-against-accidental-rm.md
index d6a1f77b..41f83778 100644
--- a/source/blog/2015-12-08-safeguarding-git-repos-against-accidental-rm.md
+++ b/source/blog/2015-12-08-safeguarding-git-repos-against-accidental-rm.md
@@ -2,7 +2,8 @@
title: "Safeguarding git repos against accidental rm"
date: 2015-12-08T00:17:39-08:00
date_display: December 8, 2015
----
+...
+
Everyone who has spent a sizable portion of their life in terminals has experienced that "oh shit" moment: you realize what you've done immediately after you've hit enter, but it's already too late. And needlessly to say, many of those are associated to accidental `rm`s.
I just had one of those moments. I was going to delete a subdirectory of `~/.config`, but hit return prematurely, and the command line ended up being `rm -r ~/.config`. Imagine the horror one second later. Fortunately I was saved by the read-only objects in `.git`, which triggered prompts; however, damage was already done, to some extent. I had to reinit the repo and do a hard reset, and a corrupted submodule was in my way (it blocked my attempt of `git reset --hard`) which I eventually had to completely remove and re-add. In the end everything was recovered (hopefully) and back to normal, but this episode was definitely not great for heart health, which led me to rethink `rm`.