-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bashrc
36 lines (32 loc) · 1.11 KB
/
.bashrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function git_config_check() {
if [ -a .git ]
then
if [[ -z `git config --local user.name` ]] || [[ -z `git config --local user.email` ]]
then
git_config_profile_select
fi
fi
}
function git_config_profile_select() {
echo Select one of the listed profiles
echo "[1] github"
echo "[2] gitlab"
echo "[3] some_other_git_server"
read -p "[1-3] " answer
if [ $answer -eq 1 ]
then
git config --local user.name John # write your own name
git config --local user.email [email protected] # write you own email
elif [ $answer -eq 2 ]
then
git config --local user.name John # write your own name
git config --local user.email [email protected] # write you own email
elif [ $answer -eq 3 ]
git config --local user.name John # write your own name
git config --local user.email [email protected]
fi
echo Your current configs are:
echo user.name `git config --local user.name`
echo user.email `git config --local user.email`
}
alias cd='function __cd() { cd $1 && git_config_check; unset -f __cd; }; __cd'