ambevar-dotfiles/.scripts/git-sync

15 lines
317 B
Bash
Executable File

#!/bin/sh
while IFS= read -r FOLDER; do
ROOT="${FOLDER%/*}"
STATUS="$(cd "$ROOT" && git status -uno | grep "Your branch is ahead of")"
if [ -n "$STATUS" ]; then
echo "$ROOT"
echo "$STATUS"
(cd "$ROOT" && git push)
echo
fi
done <<EOF
$(find . -type d -name ".git")
EOF