Created
December 22, 2016 16:28
-
-
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
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
#!/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