3

I have tried to migrate a GIT repository to TFS Online with following command

git tf configure https://myusername.visualstudio.com/DefaultCollection $/NameOfTheProgram 
git tf checkin --deep --no-lock

It worked as it should. I got all files with history in TFS. But there is one detail that bothers me a lot. It now looks like that all the files are checked in today. It gets confusing when I go through the files, I can not see the difference between files that I changed yesterday and files that I have not touched in years.

Is there a way to migrate from GIT to TFS and retain timestamp of last check-in?

Jonathan Nixon
  • 4,940
  • 5
  • 39
  • 53
magol
  • 6,135
  • 17
  • 65
  • 120

1 Answers1

4

A check-in to TFS is always made on the date of the actual check-in. Technically it's possible, but it requires tweaking the server's registry and starting with a completely new ProjectCollection, plus the tool must be aware of this, since it needs to use a different API to check in the data.

At the moment Visual Studio Online does not provide this setting (though it would honor the API if all the check-ins were made in chronological order).

As an alternative, since you're already using GIT, why not use a Git repository on VSO and push your changes to it. Git commits retain their original timestamp, TFS will only update the date of the Push to today. The commit date remains untouched.

jessehouwing
  • 106,458
  • 22
  • 256
  • 341
  • I also have access to a local TFS server. Is it possible to do the migration to it, and then move the migrated TFS repository to TFS Online? – magol Jan 03 '14 at 18:17
  • 2
    No, there is no way to import a collection into Visual Studio Online at the moment. And TFS-to-TFS migrations have the same timestamp issues. – jessehouwing Jan 03 '14 at 18:19
  • 1
    Thank you so much that you explained this to me. And as you say, why I do not use GIT under TFS? It's a really good question. Why did not I think of that? :-) – magol Jan 03 '14 at 18:25
  • I don't know if GIT under TFS is such a good idea. I found it's merges are unreliable – mamashare Nov 20 '18 at 13:36
  • @mamashare it uses git to do the merges. So I don't understand how it's more or less reliable than Git. – jessehouwing Nov 20 '18 at 15:04