forked from jan-warchol/sensible-dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig
89 lines (61 loc) · 2.82 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
[alias]
# "SHORTCUT" ALIASES
# It can be convenient to view git output using `less`, but by default git
# turns coloring off when the output is not a tty. To override that we add
# --color=always to some aliases (and use `less -R` for viewing).
ap = add --patch # interactively select hunks to add, very useful
au = add --update # stage all changes in already tracked files
b = branch
br = branch
bv = branch --verbose --verbose # lists branches with SHAs and upstreams
c = checkout
co = checkout
# commit --verbose shows a preview of staged changes when editing the commit
# message - you no longer have to run 'git diff' before every commit :)
k = commit --verbose
ci = commit --verbose
d = diff --color=always
wd = diff --color=always --word-diff=color # mnemonic: Word-Diff
g = grep --color=always --line-number
gh5 = grep --color=always --heading --context 5
# always run log with --graph so that the topology will be visualized!
l = log --color=always --decorate --graph
# unlike plain `pull`, this won't attempt a merge that may result in conflicts
pl = pull --ff-only
rb = rebase
rbo = rebase --onto # quite useful, see examples in 'git help rebase'
rbi = rebase --interactive
rs = reset
rs1 = reset HEAD~1 # "soft undo" - remove last commit, but keep its changes
s = status --short # see also --branch option
st = status
# PRETTY LOGS
# Names are mnemonics based on common aliases of 'ls' command.
# Inspired by http://stackoverflow.com/questions/1057564/pretty-git-branch-graphs
# basic one-line log, I use it all the time
ls = !git log --color=always --decorate --graph --date=relative \
--format=tformat:'%C(auto)%h%C(reset) -%C(auto)%d%C(reset) %s %C(dim)- %an, %ad%C(reset)'
# as above, but includes all local and remote branches
la = !git ls HEAD --branches --remotes
# "Long" format - full commit message and summary of changes
ll = !git log --color=always --decorate --graph --stat-graph-width=30 --stat-count=30
# similar to ls, but always include both HEAD and its upstream (if present)
lu = !git ls HEAD `git for-each-ref --format='%(upstream:short)' HEAD $(git symbolic-ref --quiet HEAD)`
[color]
ui = auto
[core]
# display non-ASCII characters (e.g. Polish) instead of quoting them
quotepath = false
[diff]
# detect renamed files and show only actual differences between versions
renames = copies
[merge]
# in case of merge conflict also show how common ancestor looked like
conflictstyle = diff3
[push]
# the default before v2.0 was to push all matching branches, which could
# be dangerous
default = simple
[rebase]
# automatically process "fixup!" commits when rebasing interactively
autosquash = true