Skip to content

Instantly share code, notes, and snippets.

@AsheTM
Last active July 18, 2022 15:51
Show Gist options
  • Save AsheTM/a75893d14556a9cb5eb901699075e9eb to your computer and use it in GitHub Desktop.
Save AsheTM/a75893d14556a9cb5eb901699075e9eb to your computer and use it in GitHub Desktop.
Git Configuration
[alias]
all-alias = !git config -l | grep ^alias\\.
# Configuration
esc = 'config --system -e'
egc = 'config --global -e'
elc = 'config --local -e'
# Log section
adog = log --all --decorate --oneline --graph
dog = log --decorate --oneline --graph
info = log --graph --date=relative --pretty=tformat:'%Cblue%h%Creset %m%C(auto)%d%Creset %s - %Cgreen(%an %ad)%Creset'
infos = info --all
hash = log --graph --all --pretty=tformat:'- %Cgreen%h%Creset'
hashs = hash --all
# Commit with a random message
cm = 'commit -m'
amend = 'commit --amend --no-edit'
empty = 'commit --allow-empty --no-edit'
empty-commit = 'commit --allow-empty --no-edit'
random-commit = !sh -c \"git commit -m '$(curl -s http://whatthecommit.com/index.txt)'\"
# Branch
br = branch
ch = checkout
brch = 'checkout -b'
chbr = 'checkout -b'
# Hide file to get tracked locally
hide = update-index --assume-unchanged
unhide = update-index --no-assume-unchanged
all-unhide = update-index --really-refresh
hidden = ! git ls-files -v | grep '^[a-z]' | cut -c3-
# Status
st = status
ss = 'status --short'
state = status -sb
# Others
intersect = merge-base
staged = 'diff'
unstaged = 'diff --cached'
word-diff = diff --word-diff
patience-diff = diff --patience
histogram-diff = diff --histogram
undo = '!f() { git reset --hard $(rev-parse --abbrev-ref HEAD)@{${1-1}}; }; f'
# [commit]
# template = PATH_TO_TEMPLATE_GIT_COMMIT_MESSAGE_FILE/.gitmessage
[credential]
helper = store
[diff]
tool = vsc-diff
# submodule = log
algorithm = histogram
[difftool]
prompt = false
[difftool "vsc-diff"]
cmd = code --wait --diff $LOCAL $REMOTE
[diff "exif"]
textconv = exiftool
# [gc]
# reflogExpire = 90
# reflogExpireUnreachable = 30
[http]
sslVerify = false
[push]
recurseSubmodules = on-demand
[merge]
conflictStyle = diff3
[rerere]
enabled = false
[rebase]
autoSquash = false
# [status]
# submoduleSummary = true
[user]
name = USERNAME_PLACEHOLDER
email = EMAIL_PLACEHOLDER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment