[alias] ; List aliases alias = !git config --get-regexp '^alias\\.' | sed --expression s/^alias\\.// --expression s/\\ /\\\\t\\ / | sort ; Amend content to the last commit amend = commit --amend --no-edit ; Check for whitespace errors check = diff --check HEAD ; Fixup a commit into another fixup = !sh -c 'git stash --keep-index && SHA=$(git rev-parse $1) && git commit --fixup $SHA && GIT_SEQUENCE_EDITOR=: git rebase --interactive --autosquash $SHA~ && git stash pop' - ; Show file names in commits list-file = !sh -c 'git diff-tree --no-commit-id --name-only -r ${1:-HEAD}' - ; Show branches ordered by last working time last-work = branch --sort='-committerdate' --format='%(color:green)%(committerdate:relative)%(color:reset) %(refname:short)' --color=always ; Retrieve a MR locally (gitlab) mr = !sh -c 'git fetch ${2:-origin} merge-requests/$1/head:mr/$1 && git checkout mr/$1' - ; Show log on oneline oneline = log --oneline --abbrev-commit --graph ; Retrieve a PR locally (github) pr = !sh -c 'git fetch ${2:-origin} pull/$1/head:pr/$1 && git checkout pr/$1' - ; Prune local tags that don't exist on remote pt = !git tag -l | xargs git tag -d && git fetch -t ; Remove local MRs (gitlab) rmmr = !git reset --hard && git checkout master && git branch --list 'mr/*' --format '%(refname:lstrip=2)' | xargs git branch -D ; Show synchronized branches without remote stale-branch = !git fetch --all --prune && git branch --verbose | awk '/\\[gone\\]/ {print $1}'