-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig-git.sh
executable file
·32 lines (27 loc) · 1.32 KB
/
config-git.sh
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
#!/data/data/com.termux/files/usr/bin/bash
# Setup everything git related
# echo "********************************************"
# echo "**** configure git *************************"
# echo "********************************************"
echo "Configuring git ..."
gituser=$( git config --global user.name)
if [[ $gituser = '' ]]; then
read -p "Enter git username: " gituser
git config --global user.name $gituser
echo "set git config --global user.name=$gituser"
fi
gitemail=$( git config --global user.email)
if [[ $gitemail = '' ]]; then
read -p "Enter git email: " gitemail
git config --global user.email $gitemail
echo "set git config --global user.email=$gitemail"
fi
git config --global core.editor "vim"
# cp ./global-gitignore ~/.gitignore
git config --global core.excludesfile "$HOME/.gitignore"
git config --global pull.rebase false
git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=short"
git config --global alias.l "log --graph --abbrev-commit --decorate=no --date-format:'%Y-%m-%d %H:%I:%S' --format=format:'%C(03)%>|(26)%h%C(reset) %C(04)%ad%C(reset) %C(green)%<(16,trunc)%an%C(reset) %C(bold 1)%d%C(reset) %C(bold 0)%>|(1)%s%C(reset)' --all"
git config --global alias.st "status"
echo "done"
echo ""