-
Notifications
You must be signed in to change notification settings - Fork 9
/
gitconfig
86 lines (74 loc) · 2.9 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
[user]
username = JoshCheek
name = Josh Cheek
email = josh.cheek@gmail.com
signingkey = 835EDF23A78DDC9A
[color]
ui = true
[color "diff"]
whitespace = red reverse
[color "branch"]
current = green
local = yellow
remote = red
[color "status"]
added = green
changed = red
untracked = red reverse
[init]
defaultBranch = main
[pull]
rebase = false
[push]
default = upstream
[core]
excludesfile = ~/.gitignore
editor = vim
[merge]
conflictstyle = diff3
[status]
submodulesummary = true
relativePaths = true
[commit]
gpgsign = true
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[alias]
# Shorthand (shorter versions of common operations, sometimes with better defaults)
d = diff --patience --ignore-space-change
co = checkout
st = status
praise = blame
# Commits
shas = log --pretty=format:\"%H\"
hist = log --pretty=format:\"%Cgreen%h%Creset %Cblue%ad%Creset %s%C(yellow)%d%Creset %Cblue[%an]%Creset\" --graph --date=short
# Branches
# --verbose 1x shows 1st line of log, 2x: show upstream branch
br = branch --verbose --verbose --sort=-committerdate
# list current branch
brcrnt = rev-parse --abbrev-ref HEAD
# copy branch
brpb = !git brcrnt | xargs echo -n | pbcopy
# push and track current branch (got this from Kevin Altman )
put = !sh -c 'git push -u origin $(git rev-parse --abbrev-ref HEAD)'
# Author info (who all worked on this thing?)
# something like number of commits by committer (doesn't quite match up, though)
count = shortlog -sn
# list people who have committed
authors = ! git log --format=\"%ae%x01%an\" | sort -u | column -ts
# Stash (slightly better stash commands... sadly, --keep-index doesn't work well enough to be useful, works for the stash, but not the pop)
# stash untracked files, too
stpush = stash --include-untracked
# when popping, remember what was in the staging area
stpop = stash pop --index
# Pull requests (stolen from https://github.com/pd/dotfiles/blob/e2d2418f96c5d13b4b06e3f2dff78dfb51eeb49c/gitconfig#L47-48)
# call with the pull request #, it will check out the pr locally
pr = "!f() { remote=${2:-$(git remote|head -1)}; git fetch -fu $remote refs/pull/$1/head:pr/$1 && git checkout pr/$1; }; f"
# remove local branches that were created from `git pr`
pr-clean = "!git for-each-ref refs/heads/pr/* --format='%(refname)' | while read ref ; do branch=${ref#refs/heads/} ; git branch -D $branch ; done"
# Git objects (for low-level exploration of git objects)
type = cat-file -t
dump = cat-file -p