简体   繁体   中英

Azure DevOps TFVC to Git Migration

We are looking into the possibility of migrating from TFVC to GIT in Azure DevOps. There is a tool that looks like it should work for us, but it will not move the source code to the repository it creates. Our TFVC source tree resembles the below structure.

  • $/Contoso
  • $/Contoso/GreatApp1
  • $/Contoso/GreatApp1/Main (Branch)
  • $/Contoso/GreatApp1/Main/Source (folder with source code)
  • $/Contoso/GreatApp1/Main/Documentation (project documentation)
  • $/Contoso/GreatApp1/Dev (Branch)
  • $/Contoso/GreatApp1/Dev/Source (folder with source code)
  • $/Contoso/GreatApp1/Dev/Documentation (project documentation)

At the very least, I would like to convert the Main branch with documentation and source code. We have 40-50 projects that follow this structure under a single project collection, so ideally I am hoping to do this using this tool without having to rebind source control in all of the different projects. Is what I'm wanting to do possible?

The import experience is optimized for small, simple TFVC repositories or repositories that have been prepared for a migration. This means it has a few limitations.

  1. It only migrates the contents of root or a branch. For example, if you have a TFVC project at $/Fabrikam which has 1 branch and 1 folder under it, a path to import $/Fabrikam would import the folder while $/Fabrikam/<branch> would only import the branch.
  2. The imported repository and associated history (if imported) cannot exceed 1GB in size.
  3. You can import up to 180 days of history.

If you want to attempt an advanced migration with Git-TFS , that project provides documentation on how to do a migration from TFVC to Git, cloning a single branch with history or cloning all branches with merge history .

let's follow the migration guide and execute the clone command:

git tfs clone {TFVC repo URL}

Get all branches:

git tfs branch –init --all

For each branch, run these commands:

git checkout branch

git log -1

git tfs pull -c=changesetNumber

Create a new repo in the azure devops and get the repo URL. Then setup the git repository upstream:

git remote add origin {New repo URL}

Finally you push all your local changes to the Remote.

git push origin -u -all

Useful link:

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