|
| 1 | +--- |
| 2 | +title: "Getting Started with Git and TFVC Version Control" |
| 3 | +short_title: Version Control |
| 4 | +description: | |
| 5 | + While we do not migrate source control for you, we do have tools to maintain the links between work items and source code. |
| 6 | +discussionId: |
| 7 | +aliases: |
| 8 | + - /version-control/ |
| 9 | +date: 2025-06-24T12:07:31Z |
| 10 | +--- |
| 11 | + |
| 12 | +While we do not migrate source control for you, we do have tools to maintain the links between work items and source code. |
| 13 | + |
| 14 | +## Git Version Control (GIT) |
| 15 | + |
| 16 | +While we do not have any tools to migrate Git repositories, we do have tools to maintain the links between work items and source code. This is done by using the [TfsGitRepositoryTool](/_reference/reference.tools.tfsgitrepositorytool.md) configuration section. |
| 17 | + |
| 18 | +As long as the Git repos exist and have the same name, just enabling [TfsGitRepositoryTool](/_reference/reference.tools.tfsgitrepositorytool.md) is enough. If you have diferent names for the repositories, you can use the [TfsGitRepositoryTool](/_reference/reference.tools.tfsgitrepositorytool.md) configuration section to map the source repository to the target repository. |
| 19 | + |
| 20 | +## Team Foundation Version Control (TFVC) |
| 21 | + |
| 22 | +Although TFVC has been depreciated for quite some time there are still many folks that use it. We don't support migrating it directly, but if you have migrated your TFVC repository to Git, you can use the [TfsChangesetMappingTool](/_reference/reference.tools.tfschangesetmappingtool.md) to maintain the links between work items and changesets. |
| 23 | + |
| 24 | +Azure DevOps Migration Tools enable migrating work item changesets with cross project links from TFVC or git. |
| 25 | + |
| 26 | +### Migrate Changesets from TFVC to Git |
| 27 | + |
| 28 | +For a successful migration of work items changesets from TFVC to Git you need a mapping file with ChangeSetId - CommitId values that you can had to the [TfsChangesetMappingTool](/_reference/reference.tools.tfschangesetmappingtool.md). If you |
| 29 | +have migrated your TFVC repository with [git-tfs](https://github.com/git-tfs/git-tfs) you can generate this file by using the following |
| 30 | +[command](https://github.com/git-tfs/git-tfs/blob/master/doc/commands/exportmap.md). Then follow the documentation on [TfsChangesetMappingTool](/_reference/reference.tools.tfschangesetmappingtool.md) to configure the tool with this file. |
| 31 | + |
| 32 | +#### Migrate Changesets from TFVC to Git with external project links |
| 33 | + |
| 34 | +If your changesets contain cross project links make sure to update the "GitRepoMapping" configuration section. |
| 35 | + |
| 36 | +##### Use Cases |
| 37 | + |
| 38 | +Lets assume you have Project A with a TFVC repository and a Project B with Work Items, which changesets link to Project A. |
| 39 | +You wish to migrate Project A to a Git Repository in Project C and move the work Items including changesets from Project B to Project C and all |
| 40 | +changesets from Project B needs to move to the Git Repository of Project C. To achieve this follow the steps: |
| 41 | + |
| 42 | +1. Migrate your repository and make sure to create the mapping file. |
| 43 | +2. Edit the configuration file with following settings in [TfsGitRepositoryTool](/_reference/reference.tools.tfsgitrepositorytool.md): |
| 44 | + |
| 45 | +"GitRepoMapping": {"A" :"C","B" :"C"} |
| 46 | + |
| 47 | +3. Run the migration with configuration file that contain set in [TfsChangesetMappingTool](/_reference/reference.tools.tfschangesetmappingtool.md). |
| 48 | + |
| 49 | +"ChangeSetMappingFile": "C:\\git-tfs\\ChangeSetId-to-CommitId\\{mappingFile}", |
0 commit comments