-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathgit.config.sh
21 lines (16 loc) · 856 Bytes
/
git.config.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
set -e
case $1 in
-l) SCOPE="--local"
;;
-g) SCOPE="--global"
;;
*) SCOPE="--local"
;;
esac
OPTIONS="${SCOPE} --replace-all"
CMD="git config ${OPTIONS}"
${CMD} alias.lg0 "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"
${CMD} alias.lg1 "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all"
${CMD} alias.lg2 "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all"
${CMD} alias.lg !"git lg0"