Created
March 21, 2012 09:14
-
-
Save PierrickKoch/2145742 to your computer and use it in GitHub Desktop.
svn to 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 | |
| names="gama gama.wiki gama.models" | |
| sec=$(date +%s) | |
| for name in $names; do | |
| echo "svn to git for $name" | |
| cd ~/sandbox | |
| mkdir tmp.${name}.old.git.${sec} | |
| cd ~/sandbox/svn.${name} | |
| svn cleanup | |
| svn revert . -R | |
| svn update | |
| svn export . ~/sandbox/tmp.${name}.new.svn.${sec}/ | |
| cd ~/sandbox/git/${name} | |
| echo "swap" | |
| mv * ~/sandbox/tmp.${name}.old.git.${sec}/ | |
| mv ~/sandbox/tmp.${name}.new.svn.${sec}/* . | |
| git add . | |
| git commit . -m "from gama-platform.googlecode.com/svn" | |
| git push -u origin master | |
| done | |
| read -p "Clean temporary swap folders? [y/N] " CLEAN | |
| if [ "$CLEAN" = "y" ]; then | |
| cd ~/sandbox | |
| rm -rf tmp.gama.* | |
| fi | |
| echo "done" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment