-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitconfig
More file actions
96 lines (73 loc) · 2.35 KB
/
.gitconfig
File metadata and controls
96 lines (73 loc) · 2.35 KB
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
[user]
name = Anders Knudsen
email =
[core]
editor = vim
excludesfile = ~/.gitignore_global
pager = less -x4
[init]
defaultBranch = main
[push]
default = current
# Push the current branch to a branch of the same name on the remote
[fetch]
prune = true
# Automatically remove remote-tracking references that no longer exist on the remote
[diff]
tool = gvimdiff
[difftool]
prompt = false
[merge]
tool = vimdiff
conflictstyle = diff3
# Show common ancestor in merge conflicts for better context
[rerere]
enabled = true
# Reuse recorded resolution of conflicted merges
[color]
ui = true
# Enable colors in output (branch, diff, status, etc.)
[color "branch"]
current = red reverse
local = blue
remote = green
[color "diff"]
meta = yellow
frag = magenta
old = red bold
new = green
plain = white
[color "status"]
added = yellow
changed = cyan
untracked = magenta
deleted = red
header = white normal dim
[alias]
# NOTE: grow your aliases organically so you know what they're doing...
# Quick shortcuts
co = checkout
br = branch
ci = commit
st = status
stat = status
# Show diffs between staged and repo
diffs = diff --staged
# Nicely formatted git logs (git lg; git ls; git ll)
lg = log --graph --abbrev-commit --oneline --decorate=full --date=relative \
--format=format:'%C(bold blue)%h%C(reset) \
- %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) \
%C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
lga = "!git lg --all $*"
ls = log --pretty=format:"%C(green)%h\\ %C(yellow)[%ad]%Cred%d\\ %Creset%s%Cblue\\ [%an]" --decorate --date=relative
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [a:%an,c:%cn]" --decorate --numstat
# Amend previous commit
# Take all your modified files, uncommit the changes, and add them
# to the previous commit, keeping the same commit message
caa = commit -a --amend -C HEAD
# Undo last commit but keep changes in working directory
undo = reset HEAD~1 --mixed
# Show branches sorted by last commit date
recent = branch --sort=-committerdate
# Clean up local branches that have been merged
cleanup = "!git branch --merged | grep -v '\\*\\|main\\|master' | xargs -n 1 git branch -d"