This repository has been archived by the owner on Nov 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitconfig
131 lines (107 loc) · 3.2 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
[user]
email = [email protected]
name = Gonçalo Cabrita
[credential]
helper = cache --timeout 3600
[core]
editor = vim
fscache = true
autocrlf = false
excludesfile = ~/.gitignore_global
pager = "less -r"
[color]
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold # line info
old = red # deletions
new = green # additions
whitespace = red reverse
[color "status"]
added = yellow
changed = green
untracked = cyan
[gist]
private = yes
[diff "bin"]
# Use `hexdump` to diff binary files
textconv = hexdump -v -C
[alias]
# New
new = !git init && git symbolic-ref HEAD refs/heads/main
# Quick commit
c = commit
# Quick branch
b = branch
# Quick add
a = add
aa = add .
# Quick add hunks
ap = add --patch
# Quick checkout
co = checkout
# Quick push
p = push
# Quick status
s = status
# Quick log
l = log
# Quick log with patch
lp = log --patch
# Quick diff
d = diff
ds = diff --staged
# Word-based diff
wd = diff --color-words
# View history graph
graph = log --graph --abbrev-commit --decorate --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
# View abbreviated SHA, description, and history graph of the latest 20 commits
ll = log --pretty=oneline -n 20 --graph --abbrev-commit
# Show verbose output about tags, branches or remotes
tags = tag -l
branches = branch -a
remotes = remote -v
# Quick commit ammend
amend = commit --amend
publish = !git commit -am \"Publish updates\" && git push
puxaforte = !git reset --hard "@{upstream}" && git clean -d -f && git pull
rip = !git reset --hard HEAD && git clean -d -f
delete = branch -D
unstage = reset HEAD --
uncommit = reset --soft HEAD^
undo = reset HEAD~
cleanup = "!f() { git remote prune origin; git branch -vv | grep 'origin/.*: gone]' | awk '{print $1}' | xargs git branch -d; }; f"
cleantags = !git tag -l | xargs git tag -d && git fetch -t
# Find branches containing commit
fb = "!f() { git branch -a --contains $1; }; f"
# Find tags containing commit
ft = "!f() { git describe --always --contains $1; }; f"
# Find commits by commit message
fm = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short --grep=$1; }; f"
# List contributors with number of commits
contributors = shortlog --summary --numbered
[apply]
# Detect whitespace errors when applying a patch
whitespace = fix
[push]
default = simple
followTags = true
[pull]
rebase = false
# URL shorthands
[url "[email protected]:"]
insteadOf = "gh:"
pushInsteadOf = "github:"
pushInsteadOf = "git://github.com/"
[url "git://github.com/"]
insteadOf = "github:"
[url "[email protected]:"]
insteadOf = "gst:"
pushInsteadOf = "gist:"
pushInsteadOf = "git://gist.github.com/"
[url "git://gist.github.com/"]
insteadOf = "gist:"