I\'d like to see how TFS will work for my command. So I\'d like to move our current GIT repository to TFS database. We\'ve used GIT for it\'s prevailed branching support so I\'d
I created a quick batch file, but you need to have Team Foundation Power Tools (tfpt.exe) in your path and For (a command line loop command)
Visual Studio Command line to your desired git folder and run the following.
git log --pretty="'%%H',%%ci - %%s" --reverse > commits
tf workspace temp /new /s:http://{TfsInstance} /i
tf workfold /map %2 . /workspace:temp
FOR /F "tokens=1* delims=','" %%a IN (commits) DO git checkout %%a && tfpt online /recursive /exclude:.git*,commits,*.obj,*.exe,_ReSharper*,obj,debug,*.user,*.suo,Bin /adds /deletes /i && tf checkin /author:"{AuthorName}" /comment:"%%b" /i
tf workspace temp /delete /i
{TtsInstance}
with your TFS URI.{AuthorName}
with your author name) the comment will include the timestamp from git (unfortunately you can't change checkin time without changing the TFS server's time and I would recommend against that) and the original author's name.This worked okay, but branches won't be perserved. I didn't take the time to figure out branching since it wasn't a big enough factor for the job at the time.
Hopefully this can save someone some time!