Created
April 25, 2024 12:35
-
-
Save tatarurzvn/c1af1d9d48c88df18d42eb8251376046 to your computer and use it in GitHub Desktop.
This file contains 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 | |
output_file="all_git_outputs.txt" | |
> "$output_file" | |
for dir in */; do | |
if [ -d "$dir/.git" ]; then | |
repo_name=$(basename "$dir") | |
echo "Processing $dir" | |
cd "$dir" | |
git fetch --all | |
git for-each-ref --format='%(committerdate)%09%(authorname)%09%(refname)' | \ | |
sort -k5n -k2M -k3n -k4n | \ | |
grep remotes | \ | |
awk -F "\t" -v repo="$repo_name" '/-000/ { printf "%-32s %-27s %s\n", repo, $2, $3 }' >> ../"$output_file" | |
cd .. | |
fi | |
done | |
echo "Output written to $output_file" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment