summaryrefslogtreecommitdiff
path: root/svn2git-sync
diff options
context:
space:
mode:
Diffstat (limited to 'svn2git-sync')
-rwxr-xr-xsvn2git-sync27
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