#!bin/bash profile=$(git config --global --get alias.profile | wc -l) if [ $profile = "0" ]; then git config --global alias.profile "!bash -c \"~/.git-switch-user \$1\"" else echo "profile alias already defined in git" fi profileget=$(git config --global --get alias.profile-get | wc -l) if [ $profileget = "0" ]; then git config --global alias.profile-get "!bash -c \"git config -f ~/.git.d/\$1 --get \$2\"" else echo "profile-get alias already defined in git" fi profileset=$(git config --global --get alias.profile-set | wc -l) if [ $profileset = "0" ]; then git config --global alias.profile-set "!bash -c \"git config -f ~/.git.d/\$1 \$2 \$3\"" else echo "profile-set alias already defined in git" fi cp ./.git-switch-user ~/.git-switch-user chmod +x ~/.git-switch-user direx=$(ls ~/ -al| grep .git.d | wc -l) if [ $direx = "0" ]; then mkdir ~/.git.d else echo ".git.d already exists" fi