A zsh prompt to encourage best practices of git. Currently it encourages you to commit frequently by showing a message on the command prompt when it sees any uncommited changes. Here is the blog post explaining why commiting frequenty is important.
See the image below – the plugin is showing Don’t forget to commit frequently
in the command prompt in red color.
- clone this repo under
$ZSH/custom/plugins
- add
zsh-git-best-practices
plugin in.zshrc
- go to your zsh theme file and add
$(git_warn)
at the end of thePS1
. For example for af-magic theme we updated PS1 inaf-magic.zsh-theme
toPS1='$FG[237]${(l.$(afmagic_dashes)..-.)}%{$reset_color%}$(git_warn)
- don't forget to source your
.zshrc
- currently the message is displayed whenever there are some uncommited changes. you can update this condition in
zsh-git-best-practices.plugin.zsh
- you can update the message to be displayed under
zsh-git-best-practices.plugin.zsh
file