Created
February 8, 2019 10:38
-
-
Save fardjad/d4499ea3bbdc26b094b4cac175b7a110 to your computer and use it in GitHub Desktop.
[find-binary-files-in-git-repo.sh] Find binary files in a git repo #git #bash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
git_files=$(git ls-files) | |
for git_file in $git_files; do | |
encoding=$(file --mime-encoding "$git_file") | |
type=$(echo "$encoding" | awk -F ': ' '{ print $2 }') | |
if [ "$type" == "binary" ]; then | |
echo $git_file | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment