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:
xxxxxxxxxx
1
2
3
if [ -n "$(git status --porcelain)" ];
4
then
5
echo "Some local changes detected !!!"
6
else
7
echo "There are no local changes."
8
fi