Skip to content

Instantly share code, notes, and snippets.

@ross-nordstrom
Last active December 25, 2015 02:39
Show Gist options
  • Save ross-nordstrom/6903918 to your computer and use it in GitHub Desktop.
Save ross-nordstrom/6903918 to your computer and use it in GitHub Desktop.
Script to "git fetch" all repos with a given prefix
#! /bin/bash
TargetDir="*"
DateStamp=$(date +"%Y%m%d");
for Dir in $(find $TargetDir* -maxdepth 0 -type d );
do
FolderName=$(basename $Dir);
cd $FolderName
pwd
# Fetch the latest code from github
git fetch &
cd ..
done
@ross-nordstrom
Copy link
Author

Might want to dump the "git fetch" output to a file instead of stdout

@codyhanson
Copy link

you should add a #! /bin/bash at the top.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment