Created
June 14, 2012 19:47
-
-
Save donthorp/2932494 to your computer and use it in GitHub Desktop.
Auto-track svn vendor branches in git
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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