Last active
May 16, 2020 13:11
-
-
Save gathuku/57042caae7da7f2a1019ad321f7f754f to your computer and use it in GitHub Desktop.
Check git changes with scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# returns true if changes present | |
if [[ `git status --porcelain` ]]; then | |
echo "Changes"; | |
else | |
echo "No changes"; | |
fi | |
# Check for a more specific file | |
# includes its name | |
if [[ `git status --porcelain index.html` ]]; then | |
echo "index.html has changes"; | |
else | |
echo "No changes in index.html"; | |
fi | |
# returns true if changes present | |
if [[ `git status --porcelain` ]]; then | |
echo "Changes"; | |
else | |
echo "No changes"; | |
fi | |
# Check for a more specific file | |
# includes its name | |
if [[ `git status --porcelain index.html` ]]; then | |
echo "index.html has changes"; | |
else | |
echo "No changes in index.html"; | |
fi | |
# returns true if changes present | |
if [[ `git status --porcelain` ]]; then | |
echo "Changes"; | |
else | |
echo "No changes"; | |
fi | |
# Check for a more specific file | |
# includes its name | |
if [[ `git status --porcelain index.html` ]]; then | |
echo "index.html has changes"; | |
else | |
echo "No changes in index.html"; | |
fi | |
# returns true if changes present | |
if [[ `git status --porcelain` ]]; then | |
echo "Changes"; | |
else | |
echo "No changes"; | |
fi | |
# Check for a more specific file | |
# includes its name | |
if [[ `git status --porcelain index.html` ]]; then | |
echo "index.html has changes"; | |
else | |
echo "No changes in index.html"; | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment