Personal library aliases for git defined
git config --global -l
git current
: Query the name of the current branchgit last
: Query info of the last commitgit undo
: Rollback last changesgit done
: Push to non-remoted branchgit history
: Display all branches like graphgit remove
: Remove specific branch
First step, open editor:
git config --global -e
Second step, paste next lines:
[alias]
current = rev-parse --abbrev-ref HEAD
last = log -1 HEAD --stat
undo = reset HEAD~1 --mixed
done = !git push origin HEAD
history = log --all --graph --decorate --oneline --simplify-by-decoration
remove = branch -d
git config --global alias.current 'rev-parse --abbrev-ref HEAD'
git config --global alias.last 'log -1 HEAD --stat'
git config --global alias.undo 'reset HEAD~1 --mixed'
git config --global alias.done '!git push origin HEAD'
git config --global alias.history 'log --all --graph --decorate --oneline --simplify-by-decoration'
git config --global alias.remove 'branch -d'