Created
January 20, 2026 14:46
-
-
Save cicorias/774948944cb2d83b617494b546554a19 to your computer and use it in GitHub Desktop.
refresh git repos from root
This file contains hidden or 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 | |
| # 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 "==========================================" |
This file contains hidden or 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
| 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