IT

[git] SVN to GIT 마이그레이션 - 1 본문

개발

[git] SVN to GIT 마이그레이션 - 1

abcee 2020. 2. 9. 23:29
$ git svn clone --no-metadata svn://1.0.0.1/migration_test_repo/trunk
Initialized empty Git repository in C:/Users/lms81/Documents/Fax/migration-test/3. git-migration/trunk/.git/
r1 = 3346962de771f3871cce348020e19f7f9d45f423 (refs/remotes/git-svn)
        A       .project
        A       .settings/org.eclipse.jdt.core.prefs
        A       .classpath
r2 = fe51588223437413daece28d530d9a9295cdfb13 (refs/remotes/git-svn)

W: +empty_dir: src/main/test
r12 = c411d9a18fb938d7598e19e2548feb76ee5cd582 (refs/remotes/git-svn)
Checked out HEAD:
  svn://1.0.0.1/migration_test_repo/trunk r12
creating empty directory: src/main/test

 

$ svn log svn://1.0.0.1/migration_test_repo | grep -c "r[0-9]"
$ svn log svn://1.0.0.1/migration_test_repo | grep -c "r[0-9]"
$ git config --global core.autocrlf input
svn_dir='2. svn-origin'
git_dir='3. git-migration'
echo "=========GIT Directory========="
find ./"${git_dir}"/sampleProject/ -not -path "*.git/*" -not -name "*.git" -type d | wc -l
echo "=========GIT Files========="
find ./"${git_dir}"/sampleProject/ -not -path "*.git/*" -type f | wc -l
echo "=========SVN Directory========="
find ./"${svn_dir}"/sampleProject/ -type d | wc -l
echo "=========SVN Files========="
find ./"${svn_dir}"/sampleProject/ -type f | wc -l

echo "=========DIFF START========="
diff -r --brief --exclude=.git ./"${svn_dir}"/sampleProject/ ./"${git_dir}"/sampleProject/
echo "========DIFF FINISHED========"
echo "========SVN EMPTY DIRECTORY========"
find ./"${svn_dir}"/sampleProject/ -empty -type d
svn_dir='./2. svn-origin/sampleProject/'
git_dir='./3. git-migration/sampleProject/'
find "${svn_dir}" -type f -exec md5sum {} \; | sed 's/"${svn_dir}"/"${git_dir}"/' > ./git_origin_md5_expect.list
md5sum --quiet -c ./git_origin_md5_expect.list > ./md5_check_result.txt
Comments