Skip to content

Instantly share code, notes, and snippets.

@kolosovsky
Created January 18, 2019 05:35
Show Gist options
  • Save kolosovsky/8d4ad98dba49b2d237fe867f354320df to your computer and use it in GitHub Desktop.
Save kolosovsky/8d4ad98dba49b2d237fe867f354320df to your computer and use it in GitHub Desktop.
repositories=( 'path/to/repo1' 'path/to/repo2' 'path/to/repo2' )
for i in "${repositories[@]}"
do
cd $i;
if [ -z "$(git status --porcelain)" ]; then
echo "repo is clean: $i";
else
git add . && git commit -m 'message';
fi
cd - > /dev/null;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment