initial scripts
This commit is contained in:
parent
3ac456f888
commit
631fedb153
|
@ -0,0 +1,7 @@
|
|||
#!/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 user.name = $name
|
||||
git config user.email = $email
|
|
@ -0,0 +1,27 @@
|
|||
#!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
|
||||
echo $(cat .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
|
Loading…
Reference in New Issue