Skip to content

Instantly share code, notes, and snippets.

@skmetz
Created January 13, 2009 12:39
Show Gist options
  • Save skmetz/46428 to your computer and use it in GitHub Desktop.
Save skmetz/46428 to your computer and use it in GitHub Desktop.
#!/bin/bash
PROJ="/Users/skm/Projects/test"
for d in `ls -d */` # get a list of all directories
do
DIR=${d/\//} # replace trailing / with nothing as in ${stringZ/replacethis/withthis}
TARGET_DIR="$PROJ/vendor"
if [ "$DIR" = "rails" ]
then
TARG="$TARGET_DIR"
else
TARG="${TARGET_DIR}/plugins"
fi
echo "Replacing $TARG/$DIR/"
rm -rf $TARG/$DIR/
cp -r $DIR $TARG/
rm -rf $TARG/$DIR/.git*
done
echo "Copying the versions_xx-xx-xx.txt file to $TARGET_DIR"
cp versions_*.txt $TARGET_DIR
#!/bin/bash
DATE=`date +%m-%e-%y`
VERSIONS="versions_as_of_$DATE.txt"
rm "$VERSIONS"
OUTPUT="../$VERSIONS"
for d in `ls -d */` # get a list of all directories
do
DIR=${d/\//} # replace trailing / with nothing as in ${stringZ/replacethis/withthis}
cd $DIR
# Update my local copy with changes made in the remote.
# This will checkout any new changes to my working copy.
echo -e "\nCleaning $DIR"
git clean -f
echo -e "Pulling $DIR"
git pull
# Record the current checked out version.
echo "--------------------------------------------------------" >> "$OUTPUT"
echo "- $DIR " >> "$OUTPUT"
echo "--------------------------------------------------------" >> "$OUTPUT"
echo "--BRANCHES (current is marked with *)--" >> "$OUTPUT"
git branch >> "$OUTPUT"
echo "" >> "$OUTPUT"
echo "--DESCRIPTION (last tag, number of commits since tag, most recent commit OR--" >> "$OUTPUT"
echo "-- in some cases just most recent commit)--" >> "$OUTPUT"
git describe --long --always >> "$OUTPUT"
echo "" >> "$OUTPUT"
echo "--MOST RECENT COMMITs--" >> "$OUTPUT"
git log -n 3 >> "$OUTPUT"
echo "" >> "$OUTPUT"
echo "--ALL TAGS in this repository--" >> "$OUTPUT"
git tag >> "$OUTPUT"
echo -e "\n\n" >> "$OUTPUT"
cd ..
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment