As project might contain some files which size is bigger than 50M or whole project size bigger than 1G, using TFS provided tool might not work to migrate to Git. The following are steps we are going to use to migrate project to Devops.
Instructions
(Please note If you have Chocolatey already installed, you can jump to step 4)
1. Open CMD as administrator
2. run following in cmd shell to install Chocolatey package manager
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
3. run following in cmd shell to test Chocolatey installation
choco
(Please note If you have Git-TFS already installed, you can jump to step 7)
4. run following in cmd shell to install gittfs through Chocolatey
choco install gittfs
5. Type "Y" when prompt to install any additional toolset.
6. run following in cmd shell to verify git-tfs installation.
git tfs help
7. run following command if want to list all TFS branches that could be cloned (Please be careful to use this command as it might take long time)
git tfs list-remote-branches http://tfsprod:8080/tfs/Marine%20Safety/
8.run following command to clone only latest code. For example: MPDIS-SDDPM (You might need to set up userName and Email for git before clone: git config – global user.name "YourName" ; git config --global user.email "xx.xx@tc.gc.ca")
git tfs clone http://tfsprod:8080/tfs/Marine%20Safety/ $/MPDIS-SDDPM_Scrum/DEVELOPMENT/MPDIS-SDDPM c:\tmp\migration\mpdis
9. or Run following command to clone all histroy from TFS. For example: MPDIS-SDDPM
git tfs clone http://tfsprod:8080/tfs/Marine%20Safety/ $/MPDIS-SDDPM_Scrum/DEVELOPMENT/MPDIS-SDDPM c:\tmp\migration\mpdis --branches=all
10. Check history: git log
11. check origin: git remote -v
12. remove origin: git remote rm origin
13. Add devops origin: git remote add origin https://tcnarwhals@dev.azure.com/tcnarwhals/MPDIS-SDDPM_Scrum/_git/MPDIS-SDDPM_Scrum
14. git push -u origin --all
Related articles
Filter by label
There are no items with the selected labels at this time.