Skip to content

Instantly share code, notes, and snippets.

@zkxs
Created June 18, 2022 22:24
Show Gist options
  • Save zkxs/ac6e7a22af8ffd2889aa83610e16b527 to your computer and use it in GitHub Desktop.
Save zkxs/ac6e7a22af8ffd2889aa83610e16b527 to your computer and use it in GitHub Desktop.
Fetch all github repos I have cloned
#!/bin/bash
process() {
pushd . > /dev/null
cd "$(dirname "$1")"
echo "$PWD"
git fetch --all
popd > /dev/null
}
find . -maxdepth 3 -type d -name '.git' | while read file; do process "$file"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment