Subir archivos a "/"
This commit is contained in:
26
listar_repos.sh
Normal file
26
listar_repos.sh
Normal file
@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
REPO_DIR="/Volumes/Git-repos"
|
||||
TMP_DIR="/tmp/git_inspect"
|
||||
|
||||
mkdir -p "$TMP_DIR"
|
||||
|
||||
for repo in "$REPO_DIR"/*.git; do
|
||||
echo "📦 Repositorio: $(basename "$repo")"
|
||||
cd "$repo" || continue
|
||||
|
||||
for branch in $(git for-each-ref --format='%(refname:short)' refs/heads/); do
|
||||
echo "├─ 🌿 Rama: $branch"
|
||||
|
||||
last_commit=$(git log -1 --pretty=format:"%ad %an - %s" --date=short "$branch")
|
||||
echo "│ └─ Último commit: $last_commit"
|
||||
|
||||
# (Opcional) Listar archivos del commit HEAD de esa rama
|
||||
echo "│ 📂 Archivos:"
|
||||
git --work-tree="$TMP_DIR" checkout -f "$branch" --quiet
|
||||
find "$TMP_DIR" -type f | sed 's|^|│ • |'
|
||||
rm -rf "$TMP_DIR"/*
|
||||
done
|
||||
|
||||
echo
|
||||
done
|
||||
Reference in New Issue
Block a user