Skip to content

Instantly share code, notes, and snippets.

@nasoym
Last active April 5, 2016 13:06
Show Gist options
  • Save nasoym/1a4f091177c513c6cd4f62b5dc44e666 to your computer and use it in GitHub Desktop.
Save nasoym/1a4f091177c513c6cd4f62b5dc44e666 to your computer and use it in GitHub Desktop.
Operation on several git folders
#!/bin/bash
find . -maxdepth 2 -type d -path "*/.git" \
| parallel -k "\
echo -e '\033[0;35m$(printf "=%.s" {1..10}) {//}\033[0m'; \
git --git-dir={} --work-tree={//} $@ \
"
#usage examples:
# git_folders.sh log -since='"1 day ago"' --oneline
# git_folders.sh status --short
# git_folders.sh pull
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment