How to prevent running script if there are changes in local Git working space
Recently I spent some time making improvements around deploying an application. Some of them are bash scripts automating some boring actions. All of them has one common part - should not be run if there are any changes (staged or not) in the local Git repository (working tree). Fortunately, it is simple to incorporate checks like this into scripts!