-
Notifications
You must be signed in to change notification settings - Fork 0
/
gitconfig
108 lines (108 loc) · 3.11 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
[color]
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = yellow
changed = blue
untracked = cyan
[alias]
# Commit all changes
c = !"c() { git add -A && git commit -am \"$1\"; }; c"
# Clone a repository including all submodules
cr = clone --recursive
# Show the diff between the latest commit and the current state
d = !"git diff | delta"
dh = !"git diff-index -w --quiet HEAD -- || clear && git --no-pager diff --patch-with-stat"
# `git di $number` shows the diff between the state `$number` revisions ago and the current state
di = !"d() { git diff --patch-with-stat HEAD~$1; }; git diff-index --quiet HEAD -- || clear; d"
# Remove branches that have been merged with master
dm = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"
# Export git repo to a zip file
ex = archive --format zip --output
# Flow
ft = "!f() { git checkout -b feature-$@; }; f"
# Switch to a branch, creating it if necessary
sw = "!f() { git checkout -b \"$1\" 2> /dev/null || git checkout \"$1\"; }; f"
# Emoji commits
i = !bash -c 'git commit -m \":sunrise: Initial commit\"'
# View abbreviated SHA, description, and history graph of the latest 20 commits
l = log --pretty=oneline -n 20 --graph --abbrev-commit
# List all git aliases
la = config --get-regexp alias
# Count lines changed (Leaderboard)
lb = shortlog -sn
# Pull in remote changes for the current repository and all its submodules
p = !"git pull && git submodule foreach git pull origin master"
# Push with origin
pu = push -u
# Sync branch remote to quickly pull origin
ps = !git branch --set-upstream-to=origin/`git symbolic-ref --short HEAD`
# Rebase on a remote branch
rb = "!git pull --rebase origin \"$1\""
# Continue rebase
rc = "!git rebase --continue"
# See status of files and branches
s = "!git status -s -b"
S = "!git status"
bs = !"git branch-status; git status -s"
mp = "!git config user.email \"[email protected]\"; rm .git/hooks/*"
[core]
excludesfile = ~/.gitignore_global
[init]
templatedir = ~/.git-templates
[push]
default = current
# Push annotated tags when pushing branches
followTags = true
[hub]
protocol = https
[difftool]
prompt = false
[diff]
tool = vimdiff
algorithm = patience
[credential]
helper = osxkeychain
[web]
browser = open
[filter "media"]
clean = git-media-clean %f
smudge = git-media-smudge %f
[url "[email protected]:"]
insteadOf = "gh:"
pushInsteadOf = "github:"
pushInsteadOf = "git://github.com/"
[url "git://github.com/"]
insteadOf = "github:"
[url "[email protected]:"]
insteadOf = "gst:"
pushInsteadOf = "gist:"
pushInsteadOf = "git://gist.github.com/"
[url "git://gist.github.com/"]
insteadOf = "gist:"
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
required = true
[remote "origin"]
fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
[user]
name = Stephen Way
email = [email protected]
signingkey = B99AA0099FE5E4E6
[github]
user = stephenway
[commit]
gpgsign = true
[gpg]
program = /usr/local/bin/gpg
[pull]
rebase = false