Created
June 22, 2017 06:09
-
-
Save lesstif/b987bc94fcf3271749e18cd33a092501 to your computer and use it in GitHub Desktop.
svn2git migration script
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 | |
## svn project | |
PRJS="test test2 test" | |
## svn repository root | |
SVN_ROOT=https://you-svn.examepl.com/svn/ | |
## git ignore list | |
IGNORE="vim,java,maven,linux,eclipse,windows,intellij" | |
## download gitignore | |
curl -k "https://www.gitignore.io/api/${IGNORE}" > gitignore | |
## loop | |
for p in ${PRJS};do | |
# echo ${SVN_ROOT}/${[}; | |
## cleaning legacy workspace | |
rm -rf ${p}; | |
mkdir -p ${p}; | |
## download gitignore | |
cp gitignore ${p}/.gitignore; | |
## running svn2git | |
cd ${p} | |
## PASSWD is svn login password, USERNAME is login id | |
yes PASSWD | svn2git -v ${SVN_ROOT}/${p} \ | |
--username USERNAME --rootistrunk | |
## add git ignore | |
git add .gitignore | |
### repeat | |
cd .. | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment