Skip to content

Instantly share code, notes, and snippets.

@andypotanin
Last active December 30, 2015 05:19
Show Gist options
  • Save andypotanin/7781509 to your computer and use it in GitHub Desktop.
Save andypotanin/7781509 to your computer and use it in GitHub Desktop.
#! /usr/bin/env bash
#
# To install globally:
# $ chmod +x vcs-update.sh
# $ ln /usr/local/bin/push push.sh
#
# Run "vcs-update" in terminal to update all directories.
#
DIRECTORIES=$PWD/*
echo "Committing and pushing all Git and SVN repositories in $DIRECTORIES";
for DIRECTORY in $DIRECTORIES
do
if [ -d "$DIRECTORY/.git" ]; then
echo "Updating Git $DIRECTORY";
cd $DIRECTORY
git add .
git commit -m "Automated commit."
git push
fi
if [ -d "$DIRECTORY/.svn" ]; then
echo "Updating SVN $DIRECTORY";
cd $DIRECTORY
svn add .
svn commit -m "Automated commit."
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment