forked from trq/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgit
68 lines (68 loc) · 2.53 KB
/
git
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
[alias]
ai = add -i
alias = !git config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1\\ => \\2/' | sort
ap = add -p
assume = update-index --assume-unchanged
assumed = "!git ls-files -v | grep ^h | cut -c 3-"
br = branch
ci = commit --verbose
cia = commit --verbose -a
ciaa = commit --verbose -a --amend
co = checkout
conflicts = !git ls-files -u | cut -f 2 | sort -u
current-branch = rev-parse --abbrev-ref HEAD
d = diff
dc = diff --cached
fo = fetch origin
fu = fetch upstream
last = cat-file commit HEAD
lc = !vim `git whatchanged -n 1 --pretty=format: --name-only`
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(green)%d%Creset %s %Cgreen(%cr) %C(blue)<%an>%Creset' --abbrev-commit --date=relative
lgp = log --graph -p --pretty=format:'%Cred%h%Creset -%C(green)%d%Creset %s %Cgreen(%cr) %C(blue)<%an>%Creset' --abbrev-commit --date=relative
ll = !git log --stat
m = merge --no-ff
mo = !git merge --no-ff origin/`git current-branch`
moff = !git merge --ff-only origin/`git current-branch`
mu = !git merge --no-ff upstream/`git current-branch`
muff = !git merge --ff-only upstream/`git current-branch`
nb = checkout -b
om = !vim `git st | grep 'modified:' | awk '{print $NF}'`
omn = !vim `git st | egrep -w 'modified:|new file:' | awk '{print $NF}'`
ours = "!f() { git checkout --ours $@ && git add $@; }; f"
owc = !vim `git whatchanged -n1 | grep ^: | awk '{print $NF}'`
po = push origin
poc = !git push origin `git current-branch`
pu = push upstream
puc = !git push upstream `git current-branch`
pull = pull --ff-only
rb = rebase -i
snapshot = !git stash save --include-untracked "snapshot: $(date)" && git stash apply "stash@{0}"
st = status
theirs = "!f() { git checkout --theirs $@ && git add $@; }; f"
todo = !ag TODO src/
unassume = update-index --no-assume-unchanged
uncommit = reset --soft HEAD^
unstage = reset HEAD
us = !git reset HEAD $1
usa = !git reset HEAD $(git status | grep modified | awk '{print $3}')
wc = !git whatchanged
wcp = !git whatchanged -p
[core]
excludesfile = ~/.gitignore_global
whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol
[color]
ui = true
[color "branch"]
current = green
local = blue
remote = red
[color "diff"]
meta = yellow
frag = magenta
old = red bold
new = green
whitespace = red reverse
[color "status"]
added = green
changed = green
untracked = red