Skip to content

Instantly share code, notes, and snippets.

@spidgorny
Created March 12, 2025 11:42
Show Gist options
  • Save spidgorny/581505e32b7a3ec67295394ebb310bc3 to your computer and use it in GitHub Desktop.
Save spidgorny/581505e32b7a3ec67295394ebb310bc3 to your computer and use it in GitHub Desktop.
weekly-git-report.sh
# Usage bash weekly-git-report.sh [days=7]
DAYS=${1:-7}
FOLDERS=$(find . -maxdepth 2 -name ".git" -type d | sort)
# echo $FOLDERS
ROOT=$(pwd)
echo "$FOLDERS" | while read -r folder; do
folder=$(dirname "$folder")
echo "==$folder=="
echo "$ROOT/$folder"
cd "$ROOT/$folder"
git pull
git --no-pager log --after $(date -v-"$DAYS"d +%Y-%m-%d) --pretty='%C(yellow)%h %C(cyan)%cd %Cblue%aN%C(auto)%d %Creset%s' --date-order --date=iso
git push
done
@spidgorny
Copy link
Author

Run inside the folder where you have multiple repos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment