简体   繁体   中英

SVN to GIT to TFS

I have a 5 year old SVN repo, for some business reason, we want to move to TFS. SVN-to-TFS tool from codeplex is buggy and freezes.

Thought of a different route : cloned SVN to GIT and pushed GIT repo to TFS. Below is my script

for i in "${!SVN_TRUNK[@]}"
do
    mkdir ${GIT_REPO[$i]}
    cd ${GIT_REPO[$i]}      
    fromRevision=$(svn log -l 1 -r{2013-06-01}:HEAD ${SVN_TRUNK[$i]} | awk '/^r[0-9]+/ {sub(/r/,"",$1); print  $1}' )
    toRevision=$(svn info -rHEAD ${SVN_TRUNK[$i]} | grep Revision | cut -d' ' -f2)

    git svn init ${SVN_TRUNK[$i]} --no-metadata
    echo 'svn fetch ' ${GIT_REPO[$i]} ' from ' $fromRevision ' to ' $toRevision
    git svn fetch -r $fromRevision:$toRevision

    git tf configure http://tfs:8080/tfs/defaultcollection '$/Portfolio Implementation/Versions/Iteration36RC/'${GIT_REPO[$i]}
    git tf checkin --deep
    cd ..
done

This brought many problems with it :

1.) No SVN revison in TFS to commits
2.) Date of all checkin to TFS is current date. I want date for the commit in SVN
3.) authors are all gone for all commits to TFS
4.) when I run git svn rebase to bring latest changes to my git repo it 
    says "Unable to determine upstream SVN information from working
    tree history"

Let me know someone else tried to move this way or help me understand what is going on.

There are a number of options, but you won't be able to work around the reset of the commit date, TFS always records the correct time of the actual commit to TFS, not the historical date.

The SVN Bridge for TFS allows you to have TFS act like a normal SVN repository, allowing you to do a SVN->SVN migration . The TFS Integration Toolset should work as well, but it has problems with certain ways a Subversion repository can be organized.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM