Files
dotfiles/git/.gitconfig

185 lines
4.9 KiB
INI
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[user]
email = madundead@gmail.com
name = Kostiantyn Bukliei
[includeIf "gitdir:~/Development/work/"]
path = ~/Development/work/.gitconfig
[alias]
# View abbreviated SHA, description, and history graph of the latest 20 commits
lg = log --pretty=oneline -n 20 --graph --abbrev-commit
# Checkout
co = checkout
# Branch
b = branch
# View the current working tree status using the short format
st = status -sb
# Show the diff between the latest commit and the current state
d = !"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat"
# Show the diff of staging area
dc = !"git diff --cached"
# Clone a repository including all submodules
c = clone --recursive
# Commit all changes
ca = !git add -A && git commit -av
# Switch to a branch, creating it if necessary
go = "!f() { git checkout -b \"$1\" 2> /dev/null || git checkout \"$1\"; }; f"
# Show verbose output about tags, branches or remotes
tags = tag -l
branches = branch -a
remotes = remote -v
# List aliases
aliases = config --get-regexp alias
# 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"
# Interactive rebase with the given number of latest commits
reb = "!r() { git rebase -i HEAD~$1; }; r"
# Remove the old tag with this name and tag the latest commit with it.
retag = "!r() { git tag -d $1 && git push origin :refs/tags/$1 && git tag $1; }; r"
# Find branches containing commit
fb = "!f() { git branch -a --contains $1; }; f"
# Find tags containing commit
ft = "!f() { git describe --always --contains $1; }; f"
# Find commits by source code
fc = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short -S$1; }; f"
# 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
up = pull --rebase --autostash
[apply]
# Detect whitespace errors when applying a patch
whitespace = fix
[core]
# Use custom .gitignore and .gitattributes
excludesfile = ~/.gitignore_global
attributesfile = ~/.gitattributes
ignorecase = false
# 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
whitespace = space-before-tab,-indent-with-non-tab,trailing-space
# Make git rebase safer on macOS
# More info: <http://www.git-tower.com/blog/make-git-rebase-safe-on-osx/>
trustctime = false
# Prevent showing files whose names contain non-ASCII symbols as unversioned.
# http://michael-kuehnel.de/git/2014/11/21/git-mac-osx-and-german-umlaute.html
precomposeunicode = false
# Speed up commands involving untracked files such as git status.
# https://git-scm.com/docs/git-update-index#_untracked_cache
untrackedCache = true
pager = diff-so-fancy | less --tabs=4 -RFX
[color]
# Use colors in Git commands that are capable of colored output when
# outputting to the terminal. (This is the default setting in Git ≥ 1.8.4.)
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow
frag = magenta bold
old = red bold
commit = yellow bold
whitespace = red reverse
[color "status"]
added = yellow
changed = green
untracked = cyan
[commit]
# https://help.github.com/articles/signing-commits-using-gpg/
# TODO: setup this
gpgsign = false
[diff]
# Detect copies as well as renames
renames = copies
[diff "bin"]
# Use hexdump to diff binary files
textconv = hexdump -v -C
[merge]
# Include summaries of merged commits in newly created merge commit messages
log = true
[push]
# https://git-scm.com/docs/git-config#git-config-pushdefault
default = current
autoSetupRemote = true
[branch]
autosetuprebase = always
[github]
user = "madundead"
[url "git@github.com:"]
insteadOf = "gh:"
pushInsteadOf = "github:"
pushInsteadOf = "git://github.com/"
[url "git://github.com/"]
insteadOf = "github:"
[url "git@gist.github.com:"]
insteadOf = "gst:"
pushInsteadOf = "gist:"
pushInsteadOf = "git://gist.github.com/"
[url "git://gist.github.com/"]
insteadOf = "gist:"
[diff-so-fancy]
markEmptyLines = false
[merge]
tool = nvim
[mergetool]
keepBackup = false
[mergetool "nvim"]
cmd = nvim -d $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J'
[pull]
default = current