Skip to content

Instantly share code, notes, and snippets.

@AlexRNL
Created March 16, 2020 14:18
Show Gist options
  • Save AlexRNL/f9b667a1701d350e8620ea48faa6e1df to your computer and use it in GitHub Desktop.
Save AlexRNL/f9b667a1701d350e8620ea48faa6e1df to your computer and use it in GitHub Desktop.
Git configuration
[user]
name = Alex
email = [email protected]
username = alex
[color]
ui = true
[help]
autocorrect = 20
[core]
excludesfile = ~/Documents/etc/git/global.gitignore
editor = ~/bin/nvim.appimage
[color "branch"]
upstream = cyan
[grep]
lineNumber = true
[diff]
wordRegex = [A-Za-z0-9]+|[^[:space:]]
[merge]
tool = vimdiff
[pull]
ff = yes
rebase = preserve
[rebase]
autostash = true
[branch "master"]
mergeoptions = --no-ff
[alias]
## Meta aliases ##
# List existing aliases
alias = config --get-regexp ^alias\\.
# Quote stings for aliasing commands
quote-string = "!read -r l; printf \\\"!; printf %s \"$l\" | sed 's/\\([\\\"]\\)/\\\\\\1/g'; printf \" #\\\"\\n\" #"
## Basic aliases ##
ci = commit
co = checkout
cob = checkout -b
cot = checkout -t
st = status
# Force with lease is more careful
pushf = push --force-with-lease
## Diff aliases ##
# Regular diff
df = diff -w --color-words
# Diff for staged files
dc = diff --cached -w --color-words
# Show only file names
dn = diff --name-only
# Diff for the last commit
dlc = diff -w --color-words HEAD~ HEAD
# Diff with a single char as a word (i.e. minimal diff)
dfw = diff -w --color-words --word-diff-regex=".|[^[:space:]]"
## Log display aliases ##
tree = log --oneline --graph --decorate --all --abbrev-commit --format=format:'%C(magenta)%h%C(reset) - %C(bold blue)(%ar)%C(reset) %C(white)%s%C(reset) %C(yellow)- %an%C(reset)%C(auto)%d%C(reset)'
mantis = log --oneline --decorate --format=format:'* %C(magenta)%h%C(reset): %C(white)%s%C(reset)'
## Miscellaneous ##
# Display modified files by their last modified date (in a dedicated script now)
stl = !git-stl.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment