Skip to content

Instantly share code, notes, and snippets.

@devsdmf
Last active April 3, 2018 20:10
Show Gist options
  • Select an option

  • Save devsdmf/ad1063542bc91e2b71ac5a438f84feca to your computer and use it in GitHub Desktop.

Select an option

Save devsdmf/ad1063542bc91e2b71ac5a438f84feca to your computer and use it in GitHub Desktop.

Revisions

  1. devsdmf revised this gist Apr 3, 2018. No changes.
  2. devsdmf created this gist Apr 3, 2018.
    9 changes: 9 additions & 0 deletions is_repo_dirty.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    #!/bin/bash

    function is_repo_dirty {
    local dir=$(pwd)
    [[ -n $1 ]] && dir=$1

    [[ -n $(git status --porcelain 2> /dev/null | tail -n1) ]] && return
    false
    }