git clone https://github.com/google/greasy.git ~/greasy
Additionally, add the following to your .zshrc
:
[ -f ~/greasy/greasy.zsh ] && source ~/greasy/greasy.zsh || echo 'greasy is missing'
GREasy provides a set of aliases for quick Git work: e.g.
a file # git add file
m "$MSG" # git commit -m "$MSG"
d # git diff
D # git diff --staged
gg # git grep
gf # git ls-files | grep
gl # git log --all --decorate --oneline --graph
P # git push # (dual to p)
ph # git push origin HEAD
gcontinue # git rebase --continue / git merge --continue
skip # git rebase --skip
GREeasy also provides some more complex methods that make common tasks easy.
branch # gets the current branch name
#e.g.
git push origin $(branch)
p # git pull --rebase # from tracked branch
p $branch # git checkout $branch; git pull --rebase # from origin/$branch
pa # git pull --rebase, but for ALL branches, pausing if there are merge conflicts.
ge "$PATTERN" # greps for "$PATTERN" and opens the results in your $EDITOR.
hub # opens the current repo's remote on the web, assuming it uses a 'github like' URL format.
edit # opens all the uncommited files in your $EDITOR.
last # opens all the files in the most recent commit in your $EDITOR.
run $CMD # attempts to run $CMD in the appropriate package/tooling for this project.
# See project_type in greasy.zsh for more details.
# Aliases:
r = run # e.g. node / cargo
t = run test # node test / cargo test
b = run build # node build / cargo build
Checkout greasy.zsh for the full list of aliases and functions that GREasy makes available.
- zsh
- git
- grep
- sed
- xargs
Please see the project's code of conduct and contributing guide.
Feel free to join GReasy's discussion group!
Please see the project's license.