Skip to content

A way to tell if a git repo is clean, then do something about it.

License

Notifications You must be signed in to change notification settings

aubreypwd/zsh-plugin-git-is-clean

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

git-is-clean

This function will return true or false depending on if it finds out your repo is dirty or not.

Usage

git-is-clean "path/to/repo" || echo "path/to/repo is dirty!"

In this example, if path/to/repo is dirty it will echo path/to/repo is dirty!

Requires

  • git

If you use https://github.com/aubreypwd/zsh-plugin-require we will try and install dependancies automatically.

Install

Using antigen:

antigen bundle aubreypwd/[email protected]

Development

Install the package on main:

antigen bundle ssh://[email protected]/aubreypwd/zsh-plugin-git-is-clean

...and contribute upstream by working in $HOME/.antigen/bundles/aubreypwd/zsh-plugin-git-is-clean.

How I use this

###
 # Watch repositories.
 ##
function __git-is-clean {
    git-is-clean "$1" || ( echo "🚨  $1 is dirty" && tput bel )
}
__git-is-clean "$HOME/Repos/github.com/aubreypwd/iTerm2"
__git-is-clean "$HOME/Repos/github.com/aubreypwd/Alfred.alfredpreferences"
__git-is-clean "$HOME/Repos/github.com/aubreypwd/subl-snippets"

About

A way to tell if a git repo is clean, then do something about it.

Resources

License

Stars

Watchers

Forks

Languages