Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- set -e
- # Ensure we have the `hub` command available.
- if ! [[ -x "$(command -v hub)" ]]; then
- echo "Error: 'hub' is required"
- exit 1
- fi
- # Loop through all subdirectories of the current directory that are Git repos
- for gitDir in $(ls -d ./*/.git)
- do
- parent=$(echo ${gitDir} | sed -E 's/\/.git\/?//')
- echo "running hub sync: hub --git-dir='${gitDir}' --work-tree='${parent}' sync"
- hub --git-dir="${gitDir}" --work-tree="${parent}" sync
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement