Last active
December 21, 2015 11:33
-
-
Save mlebkowski/e6fb4f379d3367c3756f to your computer and use it in GitHub Desktop.
This file contains 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 | |
if [ ! -f ".idea/nutricia.iml" ]; then | |
echo 'Run this command from the root of your project (.idea/nutricia.iml not found)' >&2 | |
exit 1; | |
fi | |
echo 'nutricia.iml filter=phar' >> .git/info/attributes | |
# on disk, there is never a trailing slash | |
git config --global filter.phar.smudge 'sed s,[.]phar/,.phar,g' | |
# when checking in, first strip the trailing slash, then add it (avoid double slashes), and remove newline at end of file | |
git config --global filter.phar.clean 'sed -e s,[.]phar/,.phar,g -e s,[.]phar,.phar/,g | perl -pe "chomp if eof" ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment