-
Notifications
You must be signed in to change notification settings - Fork 0
/
gitconfig
86 lines (80 loc) · 3.1 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
[include]
path = ~/.gitconfig.secret
[init]
defaultBranch = main
[user]
# Let git prompt me, if I forget to set a local email
# see: http://orrsella.com/2013/08/10/git-using-different-user-emails-for-different-repositories/
useConfigOnly = true
[color]
diff = auto
status = auto
branch = auto
ui = true
[alias]
ci = commit
co = checkout
cob = checkout -b
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative
br = branch
st = status -sb
find-ref = "!f() { git log --grep=\"^git-svn-id:.*@$1\" --format='%H'; }; f"
find-rev = "!f() { git svn find-rev $1; }; f"
c-p = cherry-pick
# resets the previous commit, but keeps all the changes
# from that commit in the working directory.
undo = reset HEAD~1 --mixed
# commits everything in my working directory and then does a
# hard reset to remove that commit.
# the commit is still there, but it's just unreachable.
wipe = !git add -A && git commit -qm 'WIPE SAVEPOINT' && git reset HEAD~1 --hard
# adds all changes including untracked files and creates a commit.
save = !git add -A && git commit -m 'SAVEPOINT'
# only commits tracked changes
wip = !git add -u && git commit -m "WIP"
up= !git fetch origin && git merge --ff origin/$1
# http://haacked.com/archive/2015/06/29/git-migrate/
migrate = "!f(){ CURRENT=$(git symbolic-ref --short HEAD); git checkout -b $1 && git branch --force $CURRENT ${3-'$CURRENT@{u}'} && git rebase --onto ${2-master} $CURRENT; }; f"
pp = !sh -c 'git push --set-upstream origin $(git symbolic-ref --short HEAD) && hub pull-request'
pup = !sh -c 'git push --set-upstream origin $(git symbolic-ref --short HEAD)'
standup = lg --author='Lars Tesmer' --since=yesterday
staged = diff --staged --color-moved
stash-all = stash save --include-untracked
puf = push --force-with-lease
fup = commit --amend --no-edit
diff = diff --color-moved
show = show --color-moved
delmerged = "!git co master && git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"
# see: https://stackoverflow.com/a/33244119
forcefix = "!f(){ echo -n \"Reset \\033[0;33m$(git symbolic-ref -q --short HEAD)\\033[0m to \\033[0;33m$(git for-each-ref --format='%(upstream:short)' $(git symbolic-ref -q HEAD))\\033[0m? (Y/n) \"; read -r ans; if [ \"$ans\" = \"y\" -o \"$ans\" = \"Y\" -o -z \"$ans\" ]; then git reset --hard $(git for-each-ref --format='%(upstream:short)' $(git symbolic-ref -q HEAD)); else echo \"catchup aborted\"; fi }; f"
[diff "exif"]
textconv = exiftool
[core]
whitespace = trailing-space,space-before-tab
editor = vim
ignorecase = false
pager = diff-so-fancy | less --tabs=4 -RFX
excludesfile = /home/lars/.gitignore
safecrlf = true
[diff]
renames = copies
compactionHeuristic = true
[rerere]
enabled = false
[mergetool]
keepBackup = false
[push]
default = simple
followTags = true
[merge]
ff = only
tool = meld
conflictStyle = zdiff3
[mergetool "meld"]
# Choose one of these 2 lines (not both!)
cmd = meld "$LOCAL" "$MERGED" "$REMOTE" --output "$MERGED"
# cmd = meld "$LOCAL" "$BASE" "$REMOTE" --output "$MERGED"
[stash]
showPatch = true
[pull]
ff = only