diff --git a/.git-switch-user b/.git-switch-user index 526b9d0..834eb8b 100755 --- a/.git-switch-user +++ b/.git-switch-user @@ -1,5 +1,7 @@ -name=$(git config -f ~/.git.d/$1 --get user.name ) -email=$(git config -f ~/.git.d/$1 --get user.email ) -echo "profile = $1 name = $name email = $email" -git config user.name = $name -git config user.email = $email +#!/bin/bash +profile=$1 +name=$(git config -f ~/.git.d/$profile --get user.name ) +email=$(git config -f ~/.git.d/$profile --get user.email ) +echo "profile = $profile name = $name email = $email" +git config --local user.name $name +git config --local user.email $email diff --git a/makeprofilealias.sh b/makeprofilealias.sh index 5ed0403..7e940ff 100644 --- a/makeprofilealias.sh +++ b/makeprofilealias.sh @@ -17,7 +17,7 @@ git config --global alias.profile-set "!bash -c \"git config -f ~/.git.d/\$1 \$2 else echo "profile-set alias already defined in git" fi -echo $(cat .git-switch-user) > ~/.git-switch-user +cp ./.git-switch-user ~/.git-switch-user chmod +x ~/.git-switch-user direx=$(ls ~/ -al| grep .git.d | wc -l) if [ $direx = "0" ]; then