-
Notifications
You must be signed in to change notification settings - Fork 1
/
gitconfig
70 lines (60 loc) · 2.29 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
[core]
excludesfile = ~/.gitignoreglobal
editor = nvim
[user]
email = [email protected]
name = OliverUv
[merge]
tool = vimdiff
conflictstyle = diff3
[alias]
unstage = reset HEAD --
undo = checkout --
last = log -l HEAD
o = log --oneline -15 --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit
amend = !git log -n 1 --pretty=tformat:%s%n%n%b | git commit -F - --amend
s = status
a = add
b = branch
bb = branch -rav
c = checkout
x = commit -m
xe = commit --allow-empty -m
xa = commit --amend --no-edit
m = checkout master
hub = push origin
buh = pull origin
sm = submodule
lg = log --color --graph --pretty=format:'%Cred%h%Creset %s %Cgreen%cr%C(blue) %an%Creset %C(bold cyan)%D%Creset' --abbrev-commit
# will put a file into gitignore
ignore=!([ ! -e .gitignore ] && touch .gitignore) | echo $1 >>.gitignore
# Will start a repo in this directory
this = !git init && git add . && git commit -m \"initial commit\"
# list aliases
alias = !git config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1\\t=> \\2/' | sort
# ignore/unignore file without .gitignore
assume = update-index --assume-unchanged
unassume = update-index --no-assume-unchanged
# list ignored files
assumed = "!git ls-files -v | grep ^h | cut -c 3-"
# take named stash
snapshot = !git stash save "snapshot: $(date)" && git stash apply "stash@{0}"
# Select the entirety of either our or their file in a 3 way merge.
ours = "!f() { git checkout --ours $@ && git add $@; }; f"
theirs = "!f() { git checkout --theirs $@ && git add $@; }; f"
# Reset file permissions
permission-reset = "!git diff -p -R | grep -E '^(diff|(old|new) mode)' | git apply"
# Make tmp squashed branch, use: `git tmpsquash base tip`
tmpsquash = "!f() { git checkout master && git branch -D tmp ; git checkout -b tmp $2 && git reset --soft $1 && git commit -m tmpsquash ; }; f"
[github]
user = OliverUv
[giggle]
main-window-maximized = false
main-window-geometry = 969x561+81+256
history-view-vpane-position = 438
file-view-vpane-position = 484
main-window-view = HistoryView
[diff]
algorithm = patience
[push]
default = simple