Skip to content

Instantly share code, notes, and snippets.

@LeoMcA
Last active July 8, 2021 15:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LeoMcA/ddf4c70f8d3d88ee364a3c2e80ceb28b to your computer and use it in GitHub Desktop.
Save LeoMcA/ddf4c70f8d3d88ee364a3c2e80ceb28b to your computer and use it in GitHub Desktop.
Search for references in a codebase to files that have been modified/deleted in git. Requires ripgrep.
git diff --diff-filter=D --name-only HEAD | grep -o '[^/]*$' | while read line ; do rg -i "$line" . ; done
git diff --name-only HEAD | grep -o '[^/]*$' | while read line ; do rg -i "$line" . ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment