Skip to content

Instantly share code, notes, and snippets.

@richardneish
Created March 18, 2014 09:31
Show Gist options
  • Save richardneish/9616628 to your computer and use it in GitHub Desktop.
Save richardneish/9616628 to your computer and use it in GitHub Desktop.
Scripts to operate on a set of Git repositories from the parent directory
#!/bin/bash
BASE_DIR=$(dirname $0)
for d in *
do
"${BASE_DIR}/git-do" "${d}" $*
done
#!/bin/bash
GIT_REPO=$1
shift
if [ -d "${GIT_REPO}" ] && [ -d "${GIT_REPO}/.git" ]
then
echo ${GIT_REPO}
pushd "${GIT_REPO}" > /dev/null
git $*
popd > /dev/null
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment