1
votes

we have an local DevOps Server 2019 with our old projects and I am able to clone this projects with git-tfs to local Git repositories. Everything is fine. After that I can push this repositories to our AzureDevOps Git repositories. Everything ok.

Now we have some projects and colleagues who want to use TFVC for these special projects. So my idea was to clone these projects from local TFS to Git and then use git-tfs rcheckin to push it to our AzureDevOps project.

But when I use "git-fts rcheckin --remote azuretfs" I get "error: latest TFS commit should be parent of commits being checked in"

When I use "git-tfs checin --remote azuretfs" all files are uploaded to the AzureDevOps project but without the history.

So can anyone describe what I have to do?

Note: I don't want to use the MigrationTool offered by Microsoft because of to many erros during validation the templates of work items etc. (we dont use it...)

2
I'm so sorry to tell you (as the maintainer of git-tfs) that it is not possible to do it with git-tfs. I wanted to implement it but never found the time and that surely never be since I no more spend time on this project (I don't use TFVC anymore). There is probably a very sneaky way to achieve it but with migrating only 1 branch history.Philippe

2 Answers

2
votes

For those who are looking for the same:

With the 'old' git tf tool (https://archive.codeplex.com/?p=gittf) you can migrate old TFVC project to Azure DevOps(TVFC).

If you want to migrate old TFVC projects to AzureDevOps(GIT) you should use git tfs (http://git-tfs.com/)

1
votes

What you could try without guarantee of success...

Note: As I said, you will be able to migrate the history from one branch only.

  1. Create the folder/project in TFVC where you want to put the source code.
  2. Migrate this folder with git tfs clone (to have a git commit with the git-tfs metadata required to rcheckin)
  3. Add the already migrated history repo (let's call it RepoWithHistory) as a local remote in this new repository (let's call it NewRepo). And git fetch
  4. Clean metadata for only the commit coming from RepoWithHistory with something looking like: git filter-branch -f --msg-filter "sed 's/^git-tfs-id:.*$//g'" -- --all. But be careful to keep the metadata on the commits coming from NewRepo.
  5. Use git replace --graft <sha1_of_first_commit_of_RepoWithHistory> <sha1_of_last_commit_of_NewRepo> to graft the 2 histories (the history must be on top of the one from the new one)
  6. Use git rcheckin --no-merge to migrate the history to TFVC (that will be long...)

I hope it will help.

PS: perhaps you should try to do it on a small subset of commits to be able to verify it will works before doing it in the real TFVC project.