Skip to content

martins-vds/tfvc-git-migration-scripts

Repository files navigation

README

Prerequisites

  • Install Git. See: Install Git
  • Install Github CLI. See: Installing Github CLI
  • Install Git-Tfs. See: Get git-tfs
    • You need at least .NET 4.6.2 and the 2012 or 2013 version of Team Explorer installed (or Visual Studio) depending on the version of TFS you want to target.

Before You Get Started

  • Clone this repo and initialize the submodules
git clone https://github.com/martins-vds/tfvc-git-migration-scripts.git
git submodule update --init
  • If this repo is already cloned locally, pull the latest changes:
git pull --recurse-submodules

Execution Sequence

  1. Initialize the local git repo which will be the target of the TFVC migration. Example:
.\Init-LocalRepo.ps1 -GitRepoDirectory "c:\path\to\local\git\folder" -TfsUrl "https://contoso.com/tfs/defaultcollection" -TfsRepoPath "$/Contoso/Trunk" -IgnoreFile "c:\path\to\gitignore"
  1. Initialize the Github repo which will host the migrated code. Example
.\Init-GithubRepo.ps1 -GitRepoDirectory "c:\path\to\local\git\folder" -Token "authTokenGoesHere" -Name "NameOfRepoGoesHere" -Description "DescriptionOfRepoGoesHere" -Team "TeamAssignedToRepo" -Organization "OrgNameGoesHere"
  • The "Team" argument is optional

To generate an auth token, see Creating a personal access token The auth token requires the 2 scopes: "repo" and "read:org" (under "admin:org")

  1. Pull from TFS. Example:
.\Pull-Tfs.ps1 -Changeset 1234 -IgnoreFile "c:\path\to\gitignore" -GitRepoDirectory "c:\path\to\local\git\folder"
  1. Initialize GitVersion. Example:
.\Init-GitVersion.ps1 -GitRepoDirectory "c:\path\to\local\git\folder"

⚠️⚠️⚠️ MAKE SURE THAT THE CODE BUILDS CORRECTLY COMMIT EVERY CHANGE BEFORE MOVING ON TO THE NEXT STEP ⚠️⚠️⚠️

  1. Set Next Version. Example:
.\Set-NextVersion.ps1 -NextVersion 1.0.0 -GitRepoDirectory "c:\path\to\local\git\folder"
  1. Initialize Git Flow. Example:
.\Init-GitFlow.ps1 -GitRepoDirectory "c:\path\to\local\git\folder"
  1. Push the local git repo to Github. Example:
.\Push-Github.ps1 -GitRepoDirectory "c:\path\to\local\git\folder"
  1. Cleanup TFS related configs. Example:
.\Cleanup-TfsConfigs.ps1 -GitRepoDirectory "c:\path\to\local\git\folder"

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published