-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig
135 lines (113 loc) · 4.9 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
132
133
134
135
[color]
ui = true
[format]
pretty = oneline
[push]
default = simple
[core]
excludesfile = /Users/nils/.gitignore_global
pager = diff-so-fancy | less --tabs=4 -RFX
# Good explanation of git's fast forwarding: http://ariya.ofilabs.com/2013/09/fast-forward-git-merge.html
[advice]
pushNonFastForward = false
# Deaktiviere die “how to stage/unstage/add” Tips durch git status:
statusHints = false
# Erlaube git diffdie Erkennung einfacher Umbenennungen und Kopien:
[diff]
renames = copies
tool = Kaleidoscope
[difftool "Kaleidoscope"]
cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\"
[merge]
tool = Kaleidoscope
[mergetool "Kaleidoscope"]
cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot
trustExitCode = true
# Setzte no fast-forward als Standardeinstellung
[branch "master"]
mergeoptions = "--no-ff"
[branch "perforce"]
mergeoptions = "--no-ff"
[branch "dev"]
mergeoptions = "--ff"
# [branch "ticket/PLANO-5510"]
# mergeoptions = "--no-ff"
# These are probably overwritten by .aliases
[alias]
feature = "!f() { git flow feature start $1; git checkout ticket/$1; }; f" #create branch with prefix feature
# View the current working tree status using the short format
s = !"f() { echo \"=>> git status -s ${GIT_PREFIX:-.}\"; cd ./${GIT_PREFIX:-.}; git status -s; }; f"
# Show the diff between the latest commit and the current state
d = !"f() { if [ $# == 0 ]; then echo \"=>> git diff $(git rev-parse --show-toplevel)\"; git diff $(git rev-parse --show-toplevel); else echo \"=>> git diff ${GIT_PREFIX:-.}$1\"; git diff ${GIT_PREFIX:-.}$1; fi }; f"
# d = !"f() { if [ $# == 0 ]; then echo \"=>> git diff --all $(git rev-parse --show-toplevel)\"; git diff --all $(git rev-parse --show-toplevel); else echo \"=>> git diff ${GIT_PREFIX:-.}$1\"; git diff ${GIT_PREFIX:-.}$1; fi }; f"
dc = diff --cached
# `git di $number` shows the diff between the state `$number` revisions ago and the current state
di = !"d() { git diff --patch-with-stat HEAD~$1; }; git diff-index --quiet HEAD -- || clear; d"
# Clone a repository including all submodules
clone = clone --recursive
# Never use git's checkout
# I forgot to pull before i did `git checkout -b hotfix/x.x.x`, and then we released a hotfix based on an old code.
checkout = !"f() { echo '=>> Use git co'; }; f"
# Push a repository including all tags
push = !"echo '=>> git push --tags'; git push --tags"
# Add changes to stage
a = !"f() { if [ $# == 0 ]; then echo '=>> git add --all'; git add --all; else echo \"=>> git add ${GIT_PREFIX:-.}$1\"; git add ${GIT_PREFIX:-.}$1; fi }; f"
# Commit changes with message
c = !"f() { . customGitCommit $1; }; f"
# View abbreviated SHA, description, and history graph of the latest 20 commits
l = log --pretty=format:"%C(Yellow)%h%C(reset)|%C(cyan)%ad%C(reset)|%C(bold)%C(green)%an:%C(reset)%s%C(reset)" --date=short --graph
l = !"echo '=>> git log --pretty=format:\"%C(Yellow)%h%C(reset)|%C(cyan)%ad%C(reset)|%C(bold)%C(green)%an:%C(reset)%s%C(reset)\" --date=short --graph'; git log --pretty=format:\"%C(Yellow)%h%C(reset)|%C(cyan)%ad%C(reset)|%C(bold)%C(green)%an:%C(reset)%s%C(reset)\" --date=short --graph"
# TODO: need to figure out a way to use spaces in the pretty-format
# Show verbose output about tags, branches or remotes
branches = branch -a
remotes = remote -v
# 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"
# Remove branches that have already been merged with master
# a.k.a. ‘delete merged’
dm = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"
# List contributors with number of commits
contributors = shortlog --summary --numbered
# Get lines with 'TODO' in comitted files.
todo = "grep -E '# TODO|// TODO'"
# Get lines with 'TODO' in comitted files.
sta = "stash"
# Get lines with 'TODO' in comitted files.
res = "reset"
exec = "!exec "
root = rev-parse --show-toplevel
[credential]
helper = osxkeychain
[user]
name = DerZyklop
email = [email protected]
[commit]
template = /Users/nils/.stCommitMsg
[mergetool]
keepBackup = false
prompt = false
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "sourcetree"]
cmd = /Applications/Sourcetree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
[difftool]
prompt = false
[color "diff-highlight"]
oldNormal = red bold
oldHighlight = red bold 52
newNormal = green bold
newHighlight = green bold 22
[color "diff"]
meta = 11
frag = magenta bold
commit = yellow bold
old = red bold
new = green bold
whitespace = red reverse
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true