Skip to content

Instantly share code, notes, and snippets.

@declanshanaghy
Created April 23, 2021 23:56
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 declanshanaghy/12498abe4730c0ec0db30b8fec9bbace to your computer and use it in GitHub Desktop.
Save declanshanaghy/12498abe4730c0ec0db30b8fec9bbace to your computer and use it in GitHub Desktop.
[user]
name = Declan Shanaghy
email = declan@shanaghy.com
[pager]
branch = false
[alias]
# list configured aliases
la = "!git config -l | grep alias | cut -c 7-"
br = branch
c = commit --verbose
ca = commit -a --verbose
co = checkout
cob = checkout -b
p = push
pu = "!git push --set-upstream origin \"$(git rev-parse --abbrev-ref HEAD)\""
rim = rebase -i master
s = status
# one-line log
l = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short
# list branches sorted by last modified
b = "!git for-each-ref --sort='-authordate' --format='%(authordate)%09%(objectname:short)%09%(refname)' refs/heads | sed -e 's-refs/heads/--'"
amend = commit --amend
force = push --force
unstage = reset HEAD --
reset-hard = reset --hard HEAD
# Multi stage commands
get = !git checkout master && git fetch --tags && git pull origin master
get-rewritten = "!f() { git checkout master && git branch -D $1; git fetch && git checkout $1; }; f"
# The cribl clone
cribl = "!f() { git clone git@bitbucket.org:cribl/$1.git; }; f"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment