Skip to content

Instantly share code, notes, and snippets.

@superhero
Created December 22, 2016 16:28
Show Gist options
  • Save superhero/0f87b6a7fe6271216520112664548485 to your computer and use it in GitHub Desktop.
Save superhero/0f87b6a7fe6271216520112664548485 to your computer and use it in GitHub Desktop.
run in root of multiple projects to commit and push them all at once
#!/bin/bash
# note that all commits will have the same commit message
if [ $# -eq 1 ]; then
MSG=$1
else
read -p "commit message: " MSG
fi
for d in */ ; do
cd $d
echo "$d:"
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' -
git add -A . && git commit -m "$MSG" && git push
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
cd ..
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment