Created
January 22, 2010 19:07
-
-
Save jbalogh/284042 to your computer and use it in GitHub Desktop.
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 | |
| # Export our git tree to svn for eternal IT love and happiness. | |
| ROOT=$(pwd)/svn-wankery | |
| GIT_REPO='git://github.com/jbalogh/zamboni.git' | |
| SVN_REPO='https://svn.mozilla.org/projects/zamboni' | |
| SVN=$ROOT/svn-z | |
| GIT=$ROOT/git-z | |
| mkdir -p $ROOT | |
| cd $ROOT | |
| # Make sure our repos are checked out. | |
| if [[ ! -d $SVN ]]; then | |
| git svn clone $SVN_REPO $SVN | |
| fi | |
| if [[ ! -d $GIT ]]; then | |
| git clone $GIT_REPO $GIT | |
| fi | |
| # Update svn. | |
| cd $SVN | |
| git svn rebase | |
| # Update git. | |
| cd $GIT | |
| git pull | |
| git submodule update --init | |
| GIT_REV=$(git rev-parse HEAD) | |
| # Move everything from git to svn. | |
| rsync -avC --delete --exclude .git $GIT/ $SVN/ | |
| # Update and commit to upstream. | |
| cd $SVN | |
| git add . | |
| git commit -m "Export from $GIT_REPO @ $GIT_REV" | |
| git svn dcommit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment