Skip to content

Instantly share code, notes, and snippets.

@carymrobbins
Created November 4, 2021 17:38
Show Gist options
  • Save carymrobbins/740066040b3fe57b01efaf6b17b56e99 to your computer and use it in GitHub Desktop.
Save carymrobbins/740066040b3fe57b01efaf6b17b56e99 to your computer and use it in GitHub Desktop.
Cleanup untracked files in your git index with fzf
#!/bin/bash
while IFS= read -r -d $'\n'; do
rm "$REPLY"
done < <(
git ls-files --others --exclude-standard \
| fzf -m \
--header='Select untracked files to delete (press TAB to select multiple)' \
--layout=reverse
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment