Migration of source code from TFS to Git with all history

Gopi Thakur
Gopi Thakur
Hi Team, I wanted to migrate source code from TFS to Git with all history. Kindly provide me the help to accomplish this or if not all then how old history can be migrated? Thanks & Regards, Gopi Thakur

Last updated

DougR
DougR
Check out [URL]https://github.com/git-tfs/git-tfs[/URL] .
Gopi Thakur
Gopi Thakur
Hi There, First I verified and already Git is installed and .net Framework version is 4.6 in windows server 2012 r2. I downloaded GitTfs-0.29.0.zip and was able to install successfully also I edited the “Path” System variable. But I am getting the below error while migrating using clone command. Command:- git tfs list-remote-branches [url]http://tfs.fjt.fawex.com:8080/tfs/WebApp[/url] TFS branches that clould be cloned $/Folder1/Folder2/Project1 [*] Cloning root branches is recommended! Command:- git tfs clone [url]http://tfs.fjt.fawex.com:8080/tfs/WebApp[/url] "$/Folder1/Folder2/Project1" Error:- TFS repository can not be root and must start with "$/". You may be able to resolve this problem -Try using $/C:/Program Files/Git/Folder1/Folder2/Project1 Kindly help me in resolving this. Thanks & Regards, Gopi Thakur
DougR
DougR
Could it be as easy as changing the double-quotes (") to single-quotes (') ?
Gopi Thakur
Gopi Thakur
Now I am able to download TFS Repositories with all the change sets using MSYS_NO_PATHCONV=1. While downloading in the GitBash cmd it is displaying all the changesets that is there id TFS. But when I opened the migrated Source Code in local git repository using Visual Studio and did view history I see some of the changesets are not listed though they are mentioned while downloading.
DougR
DougR
Could this be a case-sensitivity issue? Git is case sensitive; Windows is not.
Gopi Thakur
Gopi Thakur
I am sorry not able to get the above reply. Could you please explain it in details with examples?
DougR
DougR
Could you provide examples of the missing change sets? Please obfuscate the names but keep the CaSe of any LeTtErS the same. I'm wondering if there are conflicts just with CaSe. For example, in Linux/Git I can add 2 files by the names "Good" and "good" in the same directory. In Windows this is not possible and falls within the general classification of "case-sensitivity issues". By providing examples of what you're seeing during the download but NOT seeing in Visual Studio perhaps we can closer to the real problem.
Gopi Thakur
Gopi Thakur
Hi Team/ DougR, Today also I tried the below git tfs clone command line. MSYS_NO_PATHCONV=1 git tfs clone [URL]http://tfs.fjt.fawex.com:8080/tfs/WebApp[/URL] "$/Folder1/Folder2/Project1" -d --branches=all --export --export-work-item-mapping="d:\WorkItems\Mappings\workitems.txt " The above git tfs command is successfully downloading the solutions in the local git repository. While downloading it is listing all the change sets that are available before migration. But I faced 2 issues:- Issue 1:- In Visual Studio Team Explorer there is an item called Local Git Repositories.It is listing the Local Git Repository Name and I right clicked the repository name where tfs project got migrated. There were option to "Open Command Prompt". I clicked that and I got the command prompt with the local repository path listed as a current path. Then I give the command git log --all. It is first showing the few change sets but after keep on pressing the enter button gives all the change sets that were available before migration. That means all the change sets histories exists in the local path in windows machine. It is showing the git-tfs-id like below for all the change sets. git-tfs-id: [http://tfs.fjt.fawex.com:8080/tfs/WebApp]$/Folder1/Folder2/Project1;C1503 But in Solution Explorer, opening the .sln file for the same project from the local git repository and then Right click the project name(In the Solution Explorer Window)-> Source Control-> View History. It is showing less change sets. Issue 2:- d:\WorkItems\Mappings\workitems.txt is empty. Thanks & Regards, Gopi Thakur
DougR
DougR
I'd say it's time to report a bug to the Visual Studio folks.

1-10 of 10

Reply to this discussion

You cannot edit posts or make replies: You should be logged in before you can post.

Post a reply
3379 views