Skip to content

Instantly share code, notes, and snippets.

@claudius108
Last active September 29, 2023 14:08
Show Gist options
  • Save claudius108/44db2b916b9f6352c13755a47577d19b to your computer and use it in GitHub Desktop.
Save claudius108/44db2b916b9f6352c13755a47577d19b to your computer and use it in GitHub Desktop.
GIT

Filter out from the Git history all the deleted files

git log --diff-filter=D --summary > deleted-files.txt

Checkout a file that was deleted with a certain commit

git checkout <commit-id>~1 <file/path>

Get the subjects and bodies for all the commits

git --no-pager log --stat --format="===%n%s%-b" | sed '/^$/d' > ../commits-log.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment