Last active
September 13, 2018 06:08
-
-
Save bjconlan/66afbe2f9532fbf2bf9555b0a0427523 to your computer and use it in GitHub Desktop.
Simple util function for working with multiple git repositories using the same parent folder
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
#!/usr/bin/env bash | |
# To have this work on windows (without extension) nicely its easiest | |
# just to create a bat file which calls `@echo off & bash -c "gf.sh %*"` | |
REPOS=*/ | |
if [[ -r .gf ]]; then | |
REPOS=(`cat .gf`) | |
fi | |
for REPO in $REPOS; do | |
if [[ -d $REPO ]] && [[ -d $REPO/.git ]]; then | |
echo -e "\e[7m$REPO\e[27m" | |
git -C $REPO "$@" | |
else | |
echo "Unable to perform git command on directory $REPO" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment