Skip to content

Instantly share code, notes, and snippets.

@hymkor
Last active October 6, 2025 02:25
Show Gist options
  • Select an option

  • Save hymkor/bb6c8ded57057bc8c3e8ba48cac6797a to your computer and use it in GitHub Desktop.

Select an option

Save hymkor/bb6c8ded57057bc8c3e8ba48cac6797a to your computer and use it in GitHub Desktop.
`git new` すると、`git init`したのち、CRLF/LF 変換を無効にしたり、メアドを登録したり、対象外ファイルを登録したりするスクリプト
#!/bin/sh
EMAIL=$1
if [ -z "$EMAIL" ] ; then
EMAIL=3752189+hymkor@users.noreply.github.com
fi
if [ ! -e .git ] ; then
git init
fi
git config --local user.email "$EMAIL"
git config --local core.quotepath false
git config --local user.name HAYAMA_Kaoru
if [ ! -e .gitattributes ] ; then
echo "* -text" > .gitattributes
git add .gitattributes
git commit -m "Add .gitattributes as autocrlf=false"
fi
for i in '*~' '*.o' '*.exe' '__*' '*.zip' 'dist' $(basename $(pwd))
do
fgrep "$i" .git/info/exclude >/dev/null || echo "$i" >> .git/info/exclude
done
#gist https://gist.github.com/hymkor/bb6c8ded57057bc8c3e8ba48cac6797a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment