Skip to content

Instantly share code, notes, and snippets.

@cicorias
Created January 20, 2026 14:46
Show Gist options
  • Select an option

  • Save cicorias/774948944cb2d83b617494b546554a19 to your computer and use it in GitHub Desktop.

Select an option

Save cicorias/774948944cb2d83b617494b546554a19 to your computer and use it in GitHub Desktop.
refresh git repos from root
#!/bin/bash
# Script to fetch and pull git repositories listed in gitrepos.txt
# Usage: ./git-pull-all.sh [path-to-gitrepos.txt]
REPO_FILE="${1:-gitrepos.txt}"
BASE_DIR="$(pwd)"
# Check if the repo file exists
if [[ ! -f "$REPO_FILE" ]]; then
echo "Error: Repository list file '$REPO_FILE' not found!"
exit 1
fi
echo "=========================================="
echo "Git Fetch & Pull - Starting"
echo "Base directory: $BASE_DIR"
echo "Reading repos from: $REPO_FILE"
echo "=========================================="
# Read each line from the file
while IFS= read -r repo || [[ -n "$repo" ]]; do
# Skip empty lines and comments
[[ -z "$repo" || "$repo" =~ ^# ]] && continue
# Trim whitespace
repo=$(echo "$repo" | xargs)
repo_path="$BASE_DIR/$repo"
echo ""
echo ">>> Processing: $repo"
if [[ -d "$repo_path" ]]; then
if [[ -d "$repo_path/.git" ]]; then
cd "$repo_path" || continue
echo " Fetching all..."
git fetch --all 2>&1 | sed 's/^/ /'
echo " Pulling..."
git pull 2>&1 | sed 's/^/ /'
cd "$BASE_DIR" || exit 1
else
echo " Warning: Not a git repository (no .git folder)"
fi
else
echo " Warning: Directory does not exist"
fi
done < "$REPO_FILE"
echo ""
echo "=========================================="
echo "Git Fetch & Pull - Complete"
echo "=========================================="
Agent-Framework-Samples
OpenAIWorkshop
Power-Fx
awesome-copilot
azure-sdk-for-python
foundry-demo-agent-webapp
microsoft-agent-framework
vscode-ai-toolkit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment