Skip to content

Instantly share code, notes, and snippets.

@oplatek
Created January 8, 2014 11:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oplatek/8315833 to your computer and use it in GitHub Desktop.
Save oplatek/8315833 to your computer and use it in GitHub Desktop.
Simple script for mirroring the changes from git repository to svn repository. Note: Consider using git svn instead.
#!/bin/bash
gitdir=$1
svndir=$2
pushd $gitdir
git ls-files |
while read f ; do
dir_name="$svndir/`dirname $f`"
# echo $dir_name
mkdir -p "$svndir/$dir_name"
cp -f "$f" "$svndir/$f"
pushd "$svndir" >/dev/null
svn add "$f"
popd >/dev/null
done
popd > /dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment