aboutsummaryrefslogtreecommitdiffstats
path: root/.gitconfig
diff options
context:
space:
mode:
authorHaralan Dobrev <hkdobrev@gmail.com>2014-06-07 16:35:16 +0200
committerMathias Bynens <mathias@qiwi.be>2014-06-07 16:35:44 +0200
commita2cc53c7c85278d8c858df7a5f9660f6f793f37e (patch)
tree3399e4f555b8a3e2fb6693d1b7b834348ed28c4c /.gitconfig
parentfa2f220ade86a6dc1c9c4749bdf33a10baa9acc5 (diff)
downloaddotfiles-a2cc53c7c85278d8c858df7a5f9660f6f793f37e.tar.gz
dotfiles-a2cc53c7c85278d8c858df7a5f9660f6f793f37e.tar.bz2
dotfiles-a2cc53c7c85278d8c858df7a5f9660f6f793f37e.zip
.gitconfig: Improve configuration
Closes #366.
Diffstat (limited to '.gitconfig')
-rw-r--r--.gitconfig30
1 files changed, 23 insertions, 7 deletions
diff --git a/.gitconfig b/.gitconfig
index e19fcd5..5bbbc3b 100644
--- a/.gitconfig
+++ b/.gitconfig
@@ -29,6 +29,9 @@
branches = branch -a
remotes = remote -v
+ # Amend the currently staged files to the latest commit
+ amend = commit --amend --reuse-message=HEAD
+
# Credit an author on the latest commit
credit = "!f() { git commit --amend --author \"$1 <$2>\" -C HEAD; }; f"
@@ -48,8 +51,12 @@
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
+
[apply]
# Detect whitespace errors when applying a patch
@@ -61,10 +68,9 @@
excludesfile = ~/.gitignore
attributesfile = ~/.gitattributes
- # Treat spaces before tabs and all kinds of trailing whitespace as an error.
+ # Treat spaces before tabs and all kinds of trailing whitespace as an error
# [default] trailing-space: looks for spaces at the end of a line
- # [default] space-before-tab: looks for spaces before tabs at the beginning of
- # a line
+ # [default] space-before-tab: looks for spaces before tabs at the beginning of a line
whitespace = space-before-tab,-indent-with-non-tab,trailing-space
# Make `git rebase` safer on OS X
@@ -86,9 +92,9 @@
[color "diff"]
meta = yellow bold
- frag = magenta bold
- old = red bold
- new = green bold
+ frag = magenta bold # line info
+ old = red bold # deletions
+ new = green bold # additions
[color "status"]
@@ -96,6 +102,16 @@
changed = green
untracked = cyan
+[diff]
+
+ # Detect copies as well as renames
+ renames = copies
+
+[help]
+
+ # Automatically correct and execute mistyped commands
+ autocorrect = 1
+
[merge]
# Include summaries of merged commits in newly created merge commit messages
@@ -125,4 +141,4 @@
[push]
- default = matching
+ default = simple