Skip to content

Instantly share code, notes, and snippets.

@tolgahanakgun
Last active February 17, 2025 09:48
Show Gist options
  • Save tolgahanakgun/07f665148133b56a4fa8015e4f9b6bdb to your computer and use it in GitHub Desktop.
Save tolgahanakgun/07f665148133b56a4fa8015e4f9b6bdb to your computer and use it in GitHub Desktop.
Git Notes

Search history of a deleted/renamed file

git log --all --pretty=oneline --follow -- path/to/file.cc

Search a piece of code in all git history

# -I: ignore binary
# -F: fixed string
# -G: basic regex
git rev-list --all | while read revision; do git grep -I -F 'def run_in_parallel' ':(exclude)*.pdf'; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment