-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgitconfig.erb
More file actions
45 lines (42 loc) · 2.86 KB
/
Copy pathgitconfig.erb
File metadata and controls
45 lines (42 loc) · 2.86 KB
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
# This file has been generated from maljub01/dotfiles.<%# Just kidding, you're looking at the generator. %>
# WARNING: Any modifications you make here will be removed (ie. moved to a backup file) if you perform an update,
# unless you add your modifications to the generator too.<%# Good Job, you're in the right place! %>
[user]
name = <%= name = %x{git config --get 2>/dev/null user.name}.strip; name.empty? ? (print "Please enter your name (for gitconfig): "; STDIN.gets.strip) : name %>
email = <%= email = %x{git config --get 2>/dev/null user.email}.strip; email.empty? ? (print "Please enter your email (for gitconfig): "; STDIN.gets.strip) : email %>
[color]
branch = auto
diff = auto
interactive = auto
status = auto
[alias]
aliases = !git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /' # List defined aliases
touch = add -N
praise = blame # When blame is not enough
delete-trailing-whitespace = "!sh -c 'for f in `git grep -Il \" $\"`; do sed -i \"s/ \\+$//\" $f; done'"
log-tree = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%%an>%Creset' --abbrev-commit --date=relative # Pretty tree graph for git log
log-compact = log --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%%an>%Creset'
new = !sh -c 'git log --reverse $1@{1}..$1@{0} "$@"' # Show what's been created by the last command
new-with-patches = !sh -c 'git log --reverse -p $1@{1}..$1@{0} "$@"' # Show what's been created by the last command (and generate patches)
prune-all = !git remote | xargs -n 1 git remote prune # Prunes all remote stale branches
sortdiff = !sh -c 'git diff "$@" | grep "^[+-]" | sort --key=1.2 | uniq -u -s1' # Diff that ignores line number changes
gitkconflict = !gitk --left-right HEAD...MERGE_HEAD
# When provided with 2 arguments: Succeeds iff the branch from the first argument contains the branch from the second argument
# When provided with 1 arguments: Succeeds iff the current branch contains the branch from the first argument
contains = "!sh -c 'if [ -z \"$2\" ]; then git branch -a --contains $1 | grep \"^* \" > /dev/null; else git branch -a --contains $2 | grep \\ $1\\$ > /dev/null; fi' -"
# Lists all branches contained in the first argument (or current branch if no argument is provided)
contained-branches = "!sh -c 'for b in `git branch -a | grep -v \"(no branch)\" | awk \"{ print \\\\$NF; }\"`; do if git contains $1 $b; then echo $b; fi; done' -"
[rerere]
enabled = 1
[push]
default = matching
[merge]
conflictstyle = diff3
tool = vimdiff
[mergetool]
keepBackup = false
prompt = false
[mergetool "kdiff3NoAuto"]
cmd = kdiff3 --L1 \"$MERGED (Base)\" --L2 \"$MERGED (Local)\" --L3 \"$MERGED (Remote)\" -o \"$MERGED\" \"$BASE\" \"$LOCAL\" \"$REMOTE\"
[mergetool "smartMeld"]
cmd = meld --diff $LOCAL $REMOTE --diff $BASE $LOCAL --diff $BASE $REMOTE --diff $LOCAL $MERGED $REMOTE