Last active
October 6, 2025 02:25
-
-
Save hymkor/bb6c8ded57057bc8c3e8ba48cac6797a to your computer and use it in GitHub Desktop.
`git new` すると、`git init`したのち、CRLF/LF 変換を無効にしたり、メアドを登録したり、対象外ファイルを登録したりするスクリプト
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/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