Skip to content

Instantly share code, notes, and snippets.

@OlegGorj
Created September 24, 2019 19:41
Show Gist options
  • Save OlegGorj/3c246bdb7a2c35ccc9536ebb43ef1530 to your computer and use it in GitHub Desktop.
Save OlegGorj/3c246bdb7a2c35ccc9536ebb43ef1530 to your computer and use it in GitHub Desktop.
commit code changes to GitHub for all storefront projects
#!/bin/bash
# commit code changes to GitHub for all storefront projects
# usage: sh ./git_helper.sh "Refactoring storefront code"
args=("$@")
root="/Users/garystafford/Documents/projects"
repos=(
storefront-demo-accounts
storefront-demo-orders
storefront-demo-fulfillment
storefront-eureka-server
storefront-zuul-proxy
storefront-kafka-docker
)
if [ -n "${args[0]}" ]; then
comment=${args[0]}
else
comment="Automated commit of changes to project"
fi
for repo in "${repos[@]}"
do
cd ${root}/${repo} && \
git add -A && \
git commit -m "${comment}" && \
git push && \
git status
echo ${repo}
done
cd ../
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment