-
Notifications
You must be signed in to change notification settings - Fork 0
/
gitconfig
94 lines (86 loc) · 3.58 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
[user]
name = Emile Bergeron
useConfigOnly = true
signingkey = 98FCE996E6EC21D3CF5528D93DCA9D70EE0F1BD0
email = emile.bergeron@shopify.com
[tag]
# forceSignAnnotated = true
[gpg]
program = /opt/dev/bin/gpg-auto-pin
[log]
date = local
[diff]
mnemonicprefix = true # Index, Work tree, Commit, Object instead of a and b.
[core]
autocrlf = false
excludesfile = ~/.gitignore
eol = lf
editor = code -w
[push]
default = simple
[alias]
#####################
# Viewing shortcuts #
#####################
me = !echo $(git config user.name) $(git config user.email) $(git config user.signingkey)
s = status -sb
loc = !git ls-files | xargs cat | wc -l
dlc = diff --cached HEAD^
f = !git ls-files | grep -i
grep = grep -Ii
l = log --graph --abbrev-commit --decorate --all --date=short --format=format:'%C(yellow)%h%C(reset) %C(bold blue)%ad%C(reset)%C(auto)%d%C(reset) %C(bold white)%s%C(reset)%C(magenta) - %an%C(reset)'
ll = !git l --simplify-by-decoration
quick-stats = ! /usr/local/bin/git-quick-stats
stat = quick-stats
rank = shortlog -sn --no-merges
history = log -u # list commits related to a file
gone = !git branch -vv | grep ': gone]'
# Get the current branch name (not so useful in itself, but used in
# other aliases)
branch-name = rev-parse --abbrev-ref HEAD
remote-branch-name = rev-parse --abbrev-ref --symbolic-full-name @{u}
# list aliases
la = !git config -l | grep alias | cut -c 7-
# Find common ancertor with another branch, the fork point.
fp = "!f() { git log -1 $(git merge-base --fork-point $1); }; f"
#################
# flow commands #
#################
feat = flow feature start
hotfix = flow hotfix start
######################
# Dangerous commands #
######################
# Unstage any files that have been added to the staging area
unstage = reset HEAD
undo = reset --soft HEAD^
bring = fetch origin # 'git bring remote-branch:local-branch' fetch a branch into a local branch.
ff = "!f() { git fetch origin $1:$1; }; f" # same as e.g. 'git bring develop:develop'
cam = commit -am
cm = commit -m
amend = commit --amend --no-edit
pub = !git push -u origin $(git branch-name)
unpub = !git push origin :$(git branch-name)
squash = "!f() { base=${1:-2}; git reset --soft $base~1 && git commit --edit -m \"$(git log --format=%B --reverse HEAD..HEAD@{1})\"; }; f"
fixup = "!f() { base=${1:-2}; git reset --soft $base~1 && git commit -C $base; }; f"
cleanup = !git fsck && git fetch -p && git gc
kill = !git gone | awk '{print $1}' | xargs git branch -D
hardreset = !git reset --hard && git clean -df # removes only untracked files
pristine = !git reset --hard && git clean -dfx # dangerous, like a new clone, nothing untracked is kept.
# Save all work into a commit "FIRE"
fire = "!git add -A && git commit -m 'FIRE FIRE FIRE' && git push origin fire-branch"
# Only pull the current branches. Useful with huge teams working on the same repo.
sync = "!git pull origin $(git branch-name) && git remote prune origin && git gc --auto && git kill"
# Removes all other remote refs. When all you care about is the current branch.
focus = !git branch -r | grep -vw "$(git remote-branch-name)" | xargs git branch -d -r
# assume-unchanged shortcuts
hidden = !git ls-files -v | grep "^[[:lower:]]"
hide = update-index --assume-unchanged
unhide = update-index --no-assume-unchanged
unhideall = "!git hidden | awk {'print $2'} | xargs git unhide"
hideall = "!git status -s | awk {'print $2'} | xargs git hide"
[include]
path = ~/.gitconfig.local
path = /Users/ebergeron/.config/dev/gitconfig
[commit]
gpgSign = true