diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2010-02-10 11:07:58 +0100 |
---|---|---|
committer | Tobias Klauser <klto@zhaw.ch> | 2010-02-10 11:07:58 +0100 |
commit | c59e6a2697048ed9917411c6f91c27266481cc27 (patch) | |
tree | 431978889aa91d8aadc382475d5905ea6b5538ae | |
parent | 0d10f0ec1586d60f53aff3c3298be17f20e16362 (diff) |
Add svn2git-sync
-rwxr-xr-x | svn2git-sync | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/svn2git-sync b/svn2git-sync new file mode 100755 index 0000000..ad0adf1 --- /dev/null +++ b/svn2git-sync @@ -0,0 +1,27 @@ +#!/bin/sh +# +# Sync git-svn repo to git repository. +# +# To be called in crontab. + +if [ $# -lt 2 ] ; then + echo "usage: ${0} GIT_SVN_REPO_CHECKOUT GIT_REPO" + exit 2 +fi + +GIT_SVN_REPO_CHECKOUT=$1 +GIT_REPO=$2 + +if [ ! -d $GIT_SVN_REPO_CHECKOUT/.git/svn ] ; then + echo "error: no git-svn checkout found in $GIT_SVN_REPO_CHECKOUT" + exit 3 +fi + +p=$(pwd) +cd $GIT_SVN_REPO_CHECKOUT +git svn rebase +git push --all $GIT_REPO + +cd $p + +# vim:ft=sh |