-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig
112 lines (87 loc) · 2.77 KB
/
.gitconfig
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
[user]
name = <NAME>
email = <EMAIL>
[color]
ui = always
branch = auto
status = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
commit = green bold
frag = magenta bold
old = red bold
new = green bold
whitespace = red reverse
[color "diff-highlight"]
oldNormal = red bold
oldHighlight = red bold 52
newNormal = green bold
newHighlight = green bold 22
[gc]
auto = 1
[grep]
break = true
heading = true
lineNumber = true
[merge]
summary = true
[alias]
# log
l = log --graph --pretty=format:'%C(yellow)%h%C(cyan)%d%Creset %s %C(white)- %an, %ar%Creset'
ll = log --graph --date=short
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
lstat = log --stat --abbrev-commit
lc = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
# how many unpushed commits do I have
ahead = log --stat @{u}..HEAD
# commit
ci = commit -m # commit with message
ca = commit -am # commit all with message
c = commit # commit
amend = commit --amend # ammend your last commit
ammend = commit --amend # ammend your last commit
# checkout and branching
co = checkout
newbranch = checkout -b
branches = branch -avv
delbranch = branch -d
# fetch prune and hard reset on master
frm = "!git fetch --prune && git reset --hard origin/master"
# get upstream changes
up = "!git fetch origin && git rebase origin/master"
ir = "!git rebase -i origin/master"
#status
st = status
stc = status -sb
# stash
sl = stash list
sa = stash apply
ss = stash save
#remote
remotes = remote -v
prune-stale-dryrun = remote prune origin --dry-run
prune-stale = remote prune origin
prune-local = "!git branch --merged master | grep -v '\\* master' | xargs -n 1 git branch -d"
# search repo, with ack style output
search = grep -I --break --heading --line-number
# diff
dl = "!git lc -1" # last commit
dlc = diff --cached HEAD^ # diff last commit
# who has worked on this repo
who = shortlog -n -s --no-merges
# standup i.e. what did i do yesterday
standup = "!git log --since yesterday --author `git config user.email` --pretty=short"
# what files are being ignored
ignored = ls-files --others --ignored --exclude-standard
# remove a branch both locally and remotely when it is no longer needed
rmb = "!f() { git branch -D $1 && git push origin :$1; }; f"
# undo all changes on this branch ,hard reset
cleanup = !git reset --hard && git clean -f
# show all aliases
aliases = "!git config -l | grep alias | cut -c 7-"
[diff]
external = git-meld