Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mattapperson/2940886 to your computer and use it in GitHub Desktop.
Save mattapperson/2940886 to your computer and use it in GitHub Desktop.
Auto-track svn vendor branches in git
#! /bin/sh
# This script expects to be in the parent directory of your github projects
#
# in /etc/cron.hourly create a script that invokes this script for each repo
#
# sudo -u USER /home/USER/PROJECTS-ROOT/update-vendor-branch.sh PROJECT-DIR-1
# sudo -u USER /home/USER/PROJECTS-ROOT/update-vendor-branch.sh PROJECT-DIR-2
echo "Updating vendor repository: $1"
cd ~USER/PROJECTS-ROOT/$1
git clean -df
git fetch --all
git reset --hard
git pull
git checkout vendor
git svn fetch
git svn rebase
git diff --shortstat vendor origin/vendor
git push
git checkout master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment