-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig
executable file
·86 lines (65 loc) · 2.72 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
[user]
email = [email protected]
name = drewry pope
[core]
pager = delta
# excludesfile = ~/.gitignore
# attributesfile = ~/.gitattributes
[interactive]
diffFilter = delta --color-only
[delta]
navigate = true # use n and N to move between diff sections
light = false # set to true if you're in a terminal w/ a light background color (e.g. the default macOS terminal)
[merge]
conflictstyle = diff3
[diff]
colorMoved = default
# tool = mvimdiff
[color]
# color opts: normal, black, red, green, yellow, blue, magenta, cyan, or white
ui = auto
interactive = auto
[difftool]
prompt = false
[pretty]
# tut: http://gitimmersion.com/lab_10.html
# ref: http://linux.die.net/man/1/git-log
# Result: <short-sha> <commit-message> (<pointer-names>) -- <commit-author-name>; <relative-time>
nice = "%C(yellow)%h%C(reset) %C(white)%s%C(cyan)%d%C(reset) -- %an; %ar"
[push]
default = simple
[alias]
# https://git.wiki.kernel.org/articles/a/l/i/Aliases.html
# `git remote prune origin`: remove remote-tracking branches that were deleted from the remote repo
# `git gc`: cleanup unnecessary files and optimize the local repository
# `git clean -df`: remove untracked files and directories from the working tree
# `git stash clear`: remove all stashed states
trim = !git remote prune origin && git gc
cleanup = !git clean -df && git stash clear
# Add untracked, remove deleted, and show status
adda = !git add -A && git status
# Fetch a repository ($1) and checkout its ref ($2) HEAD
# Use: `git browse https://github.com/necolas/dotfiles <commit-ish>`
browse = !bash -c 'git fetch $1 ${2:-HEAD} && git checkout FETCH_HEAD' -
# Diff what is staged for the next commit
diffc = diff --cached
# Diff overview
diffst = diff --stat
# Custom graph log (append any tree-ish)
graph = log --pretty=nice --date-order --graph
# Custom graph log for all branches
grapha = log --pretty=nice --date-order --graph --all
# Custom pretty log
logp = log --pretty=nice --date-order
# Diffstat log
logst = log --stat
# Short format diffstat log
logsf = log --stat --format=oneline --abbrev-commit
# Fetch and checkout a GitHub Pull Request from a remote (defaults to `origin`)
# Use: `git gh-pr 123` or `git gh-pr 123 upstream`
gh-pr = !bash -c 'git fetch -fu ${2:-origin} refs/pull/$1/head:gh-pr/$1 && git checkout gh-pr/$1' -
# Amend commit without editing
recommit = commit --amend --no-edit
# Find out who is currently active on the repository
# Displays committers in descending order of number of commits
who = shortlog --numbered --summary --email --no-merges --since="3 months"