Skip to content

Instantly share code, notes, and snippets.

@MCMaurer
Last active March 7, 2019 19:05
Show Gist options
  • Save MCMaurer/b002dbda6776aad89ea50c1a2cc6ef2c to your computer and use it in GitHub Desktop.
Save MCMaurer/b002dbda6776aad89ea50c1a2cc6ef2c to your computer and use it in GitHub Desktop.
#!/bin/bash
find . -size +100M | sed 's|^\./||g' | cat >> .gitignore; awk '!NF || !seen[$0]++' .gitignore
sort -u .gitignore > .gitignore_new && mv .gitignore_new .gitignore
# thanks to https://stackoverflow.com/questions/4035779/gitignore-by-file-size#comment67586426_5200267
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment