-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgitconfig
More file actions
79 lines (78 loc) · 3.47 KB
/
gitconfig
File metadata and controls
79 lines (78 loc) · 3.47 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
[user]
name = Tim Voet
email = tim.voet@gmail.com
[core]
excludesfile = /Users/tvoet/.gitignore_global
pager = less -S
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "sourcetree"]
cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
[push]
default = simple
[alias]
branches = branch -a
stashes = stash list
amend = commit --amend
unstage = reset -q HEAD --
discard = checkout --
uncommit = reset --mixed HEAD~
nevermind = !git reset --hard HEAD && git clean -d -f
graph = log --graph -10 --branches --remotes --tags --format=format:'%Cgreen%h %Creset• %<(75,trunc)%s (%cN, %cr) %Cred%d' --date-order
precommit = diff --cached --diff-algorithm=minimal -w
alias = ! git config --get-regexp ^alias\\. | sed -e s/^alias\\.// -e s/\\ /\\ =\\ /
delete-merged-branches = !git checkout master && git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d
branch-name = !git rev-parse --abbrev-ref HEAD
# publish - push the current branch to the remote "origin", and set it to track the upstream branch
publish = !git push -u origin $(git branch-name)
# unpublish Delete the remove version of the current branch
unpublish = !git push origin :$(git branch-name)
#
# logs related
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
lds = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short
ld = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative
le = log --oneline --decorate
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit
plog = log --graph --pretty='format:%C(red)%d%C(reset) %C(yellow)%h%C(reset) %ar %C(green)%aN%C(reset) %s'
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
tlog = log --stat --since='1 Day Ago' --graph --pretty=oneline --abbrev-commit --date=relative
# merge related -- removes merged branches
bdm = "!git branch --merged | grep -v '*' | xargs -n 1 git branch -d"
# file related
filelog = log -u
fl = log -u
# diff related
dl = "!git ll -1"
dlc = diff --cached HEAD^
dr = "!f() { git diff "$1"^.."$1"; }; f"
lc = "!f() { git ll "$1"^.."$1"; }; f"
diffr = "!f() { git diff "$1"^.."$1"; }; f"
ldf = "!f() { git diff --name-only \"$(git merge-base HEAD $1)\"; }; f"
# find/grep related
f = "!git ls-files | grep -i"
grep = grep -Ii
gr = grep -Ii
gra = "!f() { A=$(pwd) && TOPLEVEL=$(git rev-parse --show-toplevel) && cd $TOPLEVEL && git grep --full-name -In $1 | xargs -I{} echo $TOPLEVEL/{} && cd $A; }; f"
# meta - lists all your git aliases
la = "!git config -l | grep alias | cut -c 7-"
# rename the <current_branch> to done-<current_branch>
done = "!f() { git branch | grep "$1" | cut -c 3- | grep -v done | xargs -I{} git branch -m {} done-{}; }; f"
cb = "checkout -b"
springcleaning = for-each-ref --sort=-committerdate --format='%(refname:short) %(committerdate:short)'
[color]
ui = true
[help]
autocorrect = 1
[filter "stripWhitespace"]
clean = strip_whitespace
[filter "media"]
clean = git-media-clean %f
smudge = git-media-smudge %f
[pager]
blame = less -S
[grep]
fullname = true