-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig##
84 lines (67 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
76
77
78
79
80
81
82
83
84
[user]
email = [email protected]
name = Charlie Cooksey
[push]
default = simple
followTags = true
[core]
editor = vim
[color]
ui = auto
[color "branch"]
current = yellow bold
local = green bold
remote = cyan bold
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
whitespace = red reverse
[color "status"]
added = green bold
changed = yellow bold
untracked = red bold
[diff]
tool = vimdiff
[difftool]
prompt = false
[alias]
# via http://blog.apiaxle.com/post/handy-git-tips-to-stop-you-getting-fired/
snapshot = !git stash save "snapshot: $(date)" && git stash apply "stash@{0}"
snapshots = !git stash list --grep snapshot
# add
a = add
chunkyadd = add --patch # stage commits chunk by chunk
# branch
b = branch
bv = branch -v
# commit
ci = commit
# checkout
co = checkout
nb = checkout -b # create and switch to a new branch (mnemonic: "git new branch branchname...")
# diff
d = diff
dc = diff --cached
last = diff HEAD^
# log
lol = log --graph --decorate --pretty=oneline --abbrev-commit
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
lgi = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ci) %C(bold blue)<%an>%Creset' --abbrev-commit
# status
s = status
st = status
re = remote
ls = ls-files
# Pull Upstream
pu = !"git fetch origin -v; git fetch upstream -v; git merge upstream/master"
# Commit Amend Reuse Message HEAD
carmh = commit --amend --reuse-message=HEAD
# Push Current
pc = !"f() { remote=\"${1:-origin}\"; git push -u \"$remote\" $(git rev-parse --abbrev-ref HEAD); }; f"
# Push Current Force
pcf = !"f() { echo git pc \"$@\" -f; }; f"
# Mainly for YADM
untracked = !"f() { git status --porcelain=v1 -zunormal | xargs -0n1 printf \"%s\\n\" | grep -E '^\\?\\? \\.' | cut -c4-; }; f"