-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitconfig
75 lines (64 loc) · 2.01 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
[user]
name = Patrik Henningsson
email = [email protected]
[core]
excludesfile = ~/.gitignore
quotepath = false
editor = vim
[push]
# Push the current branch to its upstream branch
default = tracking
[color]
# Use colors in Git commands that are capable of colored output when outputting to the terminal
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 = green
untracked = cyan
[alias]
# Shortcuts
st = status
ci = commit
br = branch
co = checkout
sm = submodule
df = diff
# Show verbose output about tags, branches or remotes
tags = tag -l
branches = branch -a
remotes = remote -v
staged = diff --staged
# View the current working tree status using the short format
s = status -s
# View the SHA, description, and history graph of the latest 20 commits
l = log --pretty=oneline -n 20 --graph
# View detailed view of commit history
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
# Show the diff between the latest commit and the current state
d = !"git diff-index --quiet HEAD -- || clear; git 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"
# `git squash $number` shows the diff between the state `$number` revisions ago and the current state
squash = !"squash() { git rebase -i HEAD~$1; }; squash"
# Undo last commit (changed files are preserved)
undo = reset --soft HEAD~1
# Show author summary
who = shortlog --numbered --summary
# Open global config
cfg = config --global -e
# Show filehistory for a given file
filehistory = log -p --follow
[merge]
tool = opendiff
[mergetool]
# Cleanup *.orig file after merge-conflicts
keepBackup = false