EN
Bash - detect if git project directory contains changes
7
points
In this short article, we would like to show how to check if a project directory that uses Git contains some local changes.
Quick solution:
#!/bin/bash
if [ -n "$(git status --porcelain)" ];
then
echo "Some local changes detected !!!"
else
echo "There are no local changes."
fi