chore(blog): New blogpost! "finding deleted content using git logs"
All checks were successful
Deploy website / build-and-deploy (push) Successful in 5m4s
All checks were successful
Deploy website / build-and-deploy (push) Successful in 5m4s
Signed-off-by: SindreKjelsrud <sindre@kjelsrud.dev>
This commit is contained in:
parent
67202040dc
commit
5cf59d5395
1 changed files with 18 additions and 0 deletions
18
src/content/blog/finding-deleted-content-using-git-logs.md
Normal file
18
src/content/blog/finding-deleted-content-using-git-logs.md
Normal file
|
@ -0,0 +1,18 @@
|
|||
---
|
||||
title: "finding deleted content using git logs"
|
||||
pubDate: 'Aug 21 2025'
|
||||
description: ""
|
||||
draft: false
|
||||
---
|
||||
|
||||
I write my notes in markdown and keep it version-controlled using `git`. And this week I needed a note I knew I had some years ago, but I couldn't find it. It drove me nuts, but then I remembered this is exactly why I use git for my notes!
|
||||
|
||||
So, if you're like me, and have accidentally deleted something - either it be a whole file or parts of a file - and want to recover it, you can use `git` to search the git-history for a specific string.
|
||||
|
||||
Using the command below will return back any commit that includes the string in the diff.
|
||||
|
||||
```bash
|
||||
git log -i -p -S "search string"
|
||||
```
|
||||
|
||||
Thought I could share it as it helped me a lot this time, and I know for sure I'll use it at some point later in my career aswell.
|
Loading…
Add table
Add a link
Reference in a new issue