Skip to content

Instantly share code, notes, and snippets.

@ageis
Last active October 18, 2023 16:37
Show Gist options
  • Save ageis/fec61712de979f3e1513a5e903804445 to your computer and use it in GitHub Desktop.
Save ageis/fec61712de979f3e1513a5e903804445 to your computer and use it in GitHub Desktop.
@ageis .gitconfig
[user]
email = [email protected]
name = Kevin M. Gallagher
signingkey = 0x3B324F4FF73BECF8
[core]
editor = vim
excludesfile = /etc/gitignore
autocrlf = true
compression = 9
fscache = true
symlinks = true
filemode = false
alternateRefsCommand="exit 0 #"
fsyncObjectFiles = true
[alias]
addremove = !git r && git add . --all
aliases = !git config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1\\ \t => \\2/' | sort
all = add . --all
amend = !git log -n 1 --pretty=tformat:%s%n%n%b | git commit -F - --amend
br = branch -av
brdel = branch -D
brname = !git branch | grep "^*" | awk '{ print $2 }'
changes = "!f() { git log --pretty=format:'* %s' $1..$2; }; f"
churn = !git log --all -M -C --name-only --format='format:' "$@" | sort | grep -v '^$' | uniq -c | sort | awk 'BEGIN {print "count,file"} {print $1 "," $2}'
ci = commit
cleanup = "!git branch --merged | grep -v '\\*\\|master\\|develop\\|release' | xargs -n 1 git branch -d"
cmp = "!git checkout master && git pull"
co = checkout
cob = checkout -b
cot = checkout -t
details = log -n1 -p --format=fuller
dsf = "!f() { [ \"$GIT_PREFIX\" != \"\" ] && cd "$GIT_PREFIX"; git diff --color $@ | diff-so-fancy | less --tabs=4 -RFX; }; f"
export = archive -o latest.tar.gz -9 --prefix=latest/
fixup = "!f() { TARGET=$(git rev-parse "$1"); git commit --fixup=$TARGET ${@:2} && EDITOR=true git rebase -i --autostash --autosquash $TARGET^; }; f"
g = !git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
gitamend = "!git commit --amend --cleanup=strip --no-edit"
headless = !sh -c 'git symbolic-ref HEAD refs/heads/$0 && rm .git/index && git clean -fdx'
hist = "!git log --graph --topo-order --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset %C(cyan)<%an>%Creset' --abbrev-commit --date=relative"
in = pull --dry-run
l = "!f() { git log $* | grep '^commit ' | cut -f 2 -d ' '; }; f"
# l = log --pretty="format:'%C(yellow)%h %C(red)%G? %C(blue)%aN%C(reset) %s'" --show-signature
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative
# log_branches = "!git log --graph --all --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"
# log_plain = "!git log --graph --pretty=format:'%h -%d %s (%cr) <%an>' --abbrev-commit --"
logs = "!git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"
lol = log --graph --decorate --pretty=oneline --abbrev-commit
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
lstags = "!git fetch -v --all --tags && git for-each-ref --sort=taggerdate --format '%(refname) %(taggerdate)' refs/tags"
modified = "!git diff --minimal --compact-summary ."
out = log --branches --not --remotes
permission-reset = !git diff -p -R --no-color | grep -E \"^(diff|(old|new) mode)\" --color=never | git apply
pr = "!f() { git fetch origin pull/$1/head:pr/$1; }; f"
# pr = "pull-request"
r = !git ls-files -z --deleted | xargs -0 git rm
# restore_deleted = "!f() { DELETED=\"$1\"; LAST_COMMIT=\"$(git rev-list -n 1 HEAD -- $DELETED)\"; LAST_COMMIT+='^'; git checkout \"${LAST_COMMIT}\" -- \"$DELETED\""
# restore_previous = "!f() { PREVIOUS=\"$1\"; LAST_COMMIT=\"$(git rev-list -n 2 HEAD -- $PREVIOUS | tail -1)\"; LAST_COMMIT+='^'; git checkout \"${LAST_COMMIT}\" -- \"$PREVIOUS\""
rips = rebase -i -p -s subtree
root = rev-parse --show-toplevel
st = status -sb
stat = status -sb
status = status -sb
subup = submodule update --init
sync = annex sync
tags = tag -l
this = !git init && git add . && git commit -m \"Initial commit.\"
trim = !git reflog expire --expire=now --all && git gc --prune=now
unpushed = log --branches --not --remotes --simplify-by-decoration --decorate --oneline
unstage = reset HEAD --
untracked = "!git ls-files . --exclude-standard --others"
ver = "!git log --pretty=format:'%ai %h' -1 | perl -pe 's,(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) [^ ]+ ([a-z0-9]+),\\1\\2\\3+\\7,'"
vtags = !sh -c 'git tag -l | xargs git tag -v'
wdiff = diff --color-words
[annex]
genmetadata = true
[cola]
spellcheck = false
[color]
branch = auto
diff = auto
interactive = auto
status = auto
ui = auto
[commit]
gpgsign = false
[credential]
# helper = /usr/lib/git-core/git-credential-libsecret
# helper = manager
helper = cache --timeout=18000
[diff "astextplain"]
textconv = astextplain
[diff "clojure"]
xfuncname = "^\\(.*"
[diff]
algorithm = patience
renames = true
[difftool "sourcetree"]
cmd = '' \"$LOCAL\" \"$REMOTE\"
[fetch]
fsckObjects = true
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[github]
user = ageis
token = !cat ~/.github.token
oauth-token = !cat ~/.github.oauth-token
[gpg]
program = /usr/bin/gpg2
[http]
sslVerify = false
sslCAInfo = /etc/ssl/certs/ca-certificates.crt
# proxy = http://127.0.0.1:8118
[merge]
log = true
ff = false
[mergetool "sourcetree"]
cmd = "'' "
trustExitCode = true
[pack]
threads = 16
[pull]
rebase = true
[push]
default = matching
[rebase]
autosquash = true
[receive]
fsckObjects = true
advertisePushOptions = true
[repack]
writeBitmaps = true
[rerere]
enabled = true
[transfer]
fsckObjects = true
[url "[email protected]:"]
pushInsteadOf = kde:
[url "https://anongit.kde.org/"]
insteadOf = kde:
*~
bh_unicode_properties.cache
bin
build
build/
.cache
celerybeat-schedule
*.cover
.coverage
.coverage.*
coverage.xml
db.sqlite3
develop-eggs
develop-eggs/
dist
dist/
.dmypy.json
dmypy.json
docs/_build/
downloads/
*.egg
*.egg-info
*.egg-info/
eggs
.eggs/
eggs/
.env
env/
ENV/
env.bak/
GitHub.sublime-settings
htmlcov/
.hypothesis/
.installed.cfg
instance/
.ipynb_checkpoints
ipython_config.py
lib
lib/
lib64
lib64/
local_settings.py
*.log
*.manifest
MANIFEST
*.mo
.mr.developer.cfg
.mypy_cache/
.netrwhist
nosetests.xml
.nox/
oscrypto-ca-bundle.crt
Package Control.ca-bundle
Package Control.ca-certs/
Package Control.cache/
Package Control.ca-list
Package Control.last-run
Package Control.merged-ca-bundle
Package Control.system-ca-bundle
Package Control.user-ca-bundle
parts
parts/
pip-delete-this-directory.txt
pip-log.txt
*.pot
profile_default/
.project
__pycache__
__pycache__/
*$py.class
*.py[cod]
.pydevproject
.pyre/
.pytest_cache
.pytest_cache/
.Python
.python-version
.ropeproject
*.sage.py
[._]s[a-rt-v][a-z]
[._]*.s[a-v][a-z]
.scrapy
sdist
sdist/
Session.vim
sftp-config.json
share/python-wheels/
/site
*.so
*.spec
.spyderproject
.spyproject
[._]ss[a-gi-z]
*.stTheme.cache
*.sublime-workspace
[._]*.sw[a-p]
[._]sw[a-p]
tags
target/
*.tmlanguage.cache
*.tmPreferences.cache
.tox
.tox/
[._]*.un~
var
var/
.venv
venv/
venv.bak/
.vscode/*
!.vscode/extensions.json
!.vscode/launch.json
!.vscode/settings.json
!.vscode/tasks.json
.webassets-cache
wheels/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment