Skip to content

Instantly share code, notes, and snippets.

@arnaudjuracek
Last active September 16, 2021 17:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arnaudjuracek/318872b3029f0e0de1555fd232e2f58c to your computer and use it in GitHub Desktop.
Save arnaudjuracek/318872b3029f0e0de1555fd232e2f58c to your computer and use it in GitHub Desktop.

git aliases

alias.unstage 'reset HEAD --'
alias.append 'commit --amend --no-edit'
alias.last 'log --name-status HEAD^..HEAD'
alias.skip '!git update-index --assume-unchanged'
alias.skipped '!git ls-files -v | grep ^[a-z]'
alias.unskip '!git update-index --no-assume-unchanged'
alias.amend '!git commit --amend'
alias.issues '!f() { URL=$(git config --get remote.origin.url); open ${URL/.git}/issues/$1; }; f'
alias.undo 'reset --soft HEAD^'
alias.discard 'checkout --'
alias.review '!git diff --cached -- '"'"':!package-lock.json'"'"' '"'"':!yarn.lock'"'"
alias.release '!git commit -am "Release $1" && git tag -a -m $1'
alias.alias '!git config --get-regexp alias'
alias.changelog '!git log $(git describe --tags --abbrev=0 HEAD^)..HEAD'
alias.subl-wip '!git ls-files -m --others --exclude-standard | xargs $@ subl'
alias.patch '!git --no-pager diff --no-color'
alias.wip '!if [ $(git rev-parse --abbrev-ref HEAD) = "wip" ]; then git add . && git commit -am "wip" && git push; else >&2 echo "Not on a wip branch" && exit 1; fi'
Create a new alias
git config --global alias.foo '!echo bar'
List all git aliases
git alias
git config --get-regexp alias
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment