-
Notifications
You must be signed in to change notification settings - Fork 5
/
git-essentials.sh
executable file
·31 lines (28 loc) · 1.55 KB
/
git-essentials.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
#bin/bash
echo "Creating some awesome git shortcuts!"
git config --global alias.l 'log --pretty=format:"%C(yellow)%h%Cred%d\ %Creset%s%Cblue\ [%cn]" --decorate'
git config --global alias.g "log --oneline --decorate --graph"
git config --global alias.s "status -sb"
git config --global alias.co "checkout"
git config --global alias.b "branch -avv"
git config --global alias.ll 'log --pretty=format:"%C(yellow)%h%Cred%d\ %Creset%s%Cblue\ [%cn]" --decorate --numstat'
git config --global alias.lds 'log --pretty=format:"%C(yellow)%h\ %ad%Cred%d\ %Creset%s%Cblue\ [%cn]" --decorate --date=short'
git config --global alias.ld 'log --pretty=format:"%C(yellow)%h\ %ad%Cred%d\ %Creset%s%Cblue\ [%cn]" --decorate --date=relative'
git config --global alias.filelog 'log -u'
git config --global alias.fl 'log -u'
git config --global alias.dl "!git ll -1"
git config --global alias.la "!git config -l | grep alias | cut -c 7-"
git config --global alias.cp 'cherry-pick'
git config --global alias.st 'status -s'
git config --global alias.cl 'clone'
git config --global alias.ci 'commit'
git config --global alias.br 'branch'
git config --global alias.pur 'pull --rebase'
git config --global rerere.enabled 'true'
git config --global alias.branchdiff 'log --graph --left-right --cherry-pick --oneline'
git config --global alias.sps "!git stash -u && git pull --rebase && git stash apply"
git config --global alias.apc "!git add -A && git commit && git pull --rebase && git push"
git config --global alias.ada 'add --all :/'
echo "Turning on color git UI"
git config --global color.ui true
echo "Done!"