Created
May 8, 2015 05:06
-
-
Save dalzony/0e76af1322cc80b23065 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 | |
# | |
EMAIL=$(git config --local user.email) | |
HOST=`echo $(git config remote.origin.url) | awk -F@ '{print $2}' | awk -F: '{print $1}'` | |
# 로컬 이메일이 없고, 호스트 리모트가 github.com이면 | |
if [ -z "$EMAIL" ]; then | |
# user.email is empty | |
if [ "$HOST" == 'github.com' ]; then | |
git config --local user.name "Name" | |
git config --local user.email [email protected] | |
exit 1 | |
fi | |
else | |
# user.email is not empty | |
exit 0 | |
fi |
pre-commit으로 hook에 넣어사용하세용.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
프로젝트별이라기 보다 깃헙호스트 주소 다를때