-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathgitconfig
137 lines (118 loc) · 4.41 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
136
137
[alias]
# Better version of the stash list command
# Taken from https://stackoverflow.com/a/38826108/1245380
sl = stash list --format='%C(red)%h%C(reset) - %C(yellow)(%C(bold magenta)%gd%C(yellow))%C(reset) %<(70,trunc)%s %C(green)(%cr) %C(bold blue)%C(reset)'
# Shorten a few common commands
comt = commit-ticket
# Stash all files, including untracked files and directories
stash-all = stash save --include-untracked
# Soft reset to get to the way things were before the last commit was made
undo = reset --soft HEAD^
# Show the branches, ordered by most recently updated closest to prompt.
# Also shows the last commit and committer for each branch listed.
recent = for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'
# Graph/Log aliases
lp = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
ll = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
graph = log --graph --all --decorate --stat --date=iso
graph1 = log --date-order --decorate --graph --oneline --no-show-signature
[color]
branch = auto
diff = auto
status = auto
[status]
# git status is a command I use a lot. The default command output contains
# information I don't need to see.
short = true
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red
new = cyan
[color "status"]
added = yellow
changed = green
untracked = cyan
[core]
# Global gitignore rules
excludesfile = ~/.gitignore_global
# Global gitattributes file
attributesFile = ~/.gitattributes
# Pay attention to case, even on OSX
ignorecase = false
# Better diff of changes
#pager = diff-so-fancy | less --tabs=4 -RFX --pattern '^(Date|added|deleted|modified): '
#pager = diff-so-fancy | less --tabs=4 -RFX
pager = diff-so-fancy | less --tabs=2
[pager]
# Don't use pager when listing branches
# Taken from https://stackoverflow.com/a/48370253/1245380
branch = false
# A better diff algorithm
algorithm = histogram
[status]
# Show status of git submodules in git status output
submoduleSummary = true
[diff]
# Show submodules changes in diffs as a list of commits like `git log` shows
submodule = log
# Default tool for resolving conflicts
tool = vimdiff3
[fetch]
# Push push submodule changes to the remote before pushing the main project.
# If a submodule fails to push the main project will not be pushed.
recurseSubmodules = on-demand
[init]
# Directory for Git templates
templatedir = ~/dotfiles/git/templates
[push]
# Push branch to remote branch with same name
default = current
[pull]
# Don't flatten locally created merge commits when rebasing
rebase = merges
[merge]
# Standard diff is two sets of final changes. This introduces the change
# present in the common ancestor of both conflicting commits.
conflictstyle = zdiff3
# Always create a merge commit when merging
ff = false
[rerere]
# Automatically apply previously resolved conflicts when they appear again
enabled = true
[rebase]
# Always auto squash when rebasing
autosquash = true
# Automatically stash local changes when rebasing
autostash = true
[branch]
# When checking out branches locally make them always track the remote branch
autosetupmerge = always
[commit]
# Show the diff below the commit message for context when writing the message
verbose = true
# Template for new commit messages
template = ~/dotfiles/templates/commit-template
# Configuration various diffs of various file types
[diff "exif"]
textconv = exiftool
# https://tech.marksblogg.com/git-track-changes-in-media-office-documents.html
# https://ongardie.net/blog/sqlite-in-git/
[diff "word"]
textconv=pandoc --to=markdown
binary=true
prompt=false
[diff "microsoftoffice"]
textconv=tika --text
binary=true
[diff "libreoffice"]
#textconv=tika --text
textconv=odt2txt
binarytrue
[diff "pdf"]
textconv=tika --text
binary=true