Skip to content

Instantly share code, notes, and snippets.

@drabb
Last active May 25, 2023 13:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drabb/ca948390d96d45c57c0ded22e7e5daee to your computer and use it in GitHub Desktop.
Save drabb/ca948390d96d45c57c0ded22e7e5daee to your computer and use it in GitHub Desktop.
Git Aliases
[user]
name = Dan Rabb
email = dan@danrabb.com
[core]
askpass = git-gui--askpass
editor = vim
[alias]
last = log -1 HEAD
logline = log --pretty=format:\"%C(yellow)%h %C(blue)%ad %C(red)(%an) %C(reset)%s\" --date=short
lol = logline
submod = submodule update --init --recursive
cmp = !sh -c 'git difftool --dir-diff $1 $2' --
dd = difftool --dir-diff
pr = !sh -c 'export EDITOR=vim && git push -u origin $(git rev-parse --abbrev-ref HEAD) && gh pr create $1' --
ac = commit -am
cp = !sh -c 'git commit -am $1 && git push' --
com = !sh -c 'git fetch --all -p && git checkout master && git pull' --
showtool = "!showci () { rev=${1:-HEAD}; git difftool $rev~1 $rev; }; showci $1"
# danger zone. credit eric musso:
cleanup = "git push origin --delete ${git branch -r --merged origin/master | grep origin | egrep -v '>|master|develop' | cut -d/ -f2- "
[diff]
tool = meld
[difftool]
prompt = false
[difftool "meld"]
cmd = meld "$LOCAL" "$REMOTE"
[color "status"]
branch = yellow
[pull]
rebase = false
[push]
autoSetupRemote = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment