Copy the block from .zshrc into your shell config. The ! variants are the "force" versions of the plain alias.
| Alias | Expands to | What for |
|---|---|---|
gs |
git status |
what changed |
gc |
git checkout |
switch branch |
pull |
git pull --rebase |
update branch without merge commits |
gp |
git push |
push |
gp! |
git push --force-with-lease |
force push after amend or rebase, refuses if remote moved |
ga! |
git commit --amend --no-edit |
fold staged changes into the last commit |
gl |
git log --graph --pretty=format:... |
compact graph log with age and author |
glb |
git for-each-ref --sort=-committerdate --count=10 ... |
last 10 branches I committed to |
| Alias | Expands to | What for |
|---|---|---|
ga |
git commit --amend |
amend and edit the message |
grs |
git restore --staged |
unstage a file |
grs! |
git restore --staged . |
unstage everything |
Amend the last commit with the latest changes and force push:
git add . && ga! && gp!