Blog: VSTS

Script to clone all Git repositories from your VSTS collection

August 23, 2016, (updated on September 26, 2017), 7 comments, Software Development

In this article I show you a PowerShell script which clones and pulls all Git repositories from your Visual Studio Team Services (VSTS) collection. I use this script to retrieve the complete code base so that I can run my code analysis tools on it. 1. Create a new PowerShell script file In the directory where you want to clone all repositories, create a new CloneAllRepos.ps1 script file with the following contents: # Read configuration file Get-Content "CloneAllRepos.config" | foreach-object -begin {$h=@{}} -process { $k = [regex]::split($_,'='); if(($k[0].CompareTo("") -ne 0) -and ($k[0].StartsWith("[") -ne $True)) { $h.Add($k[0], $k[1]) } } $url […] Read more...

Tags: , ,

Migrate a TFS repository to a VSTS Git repository

February 17, 2016, (updated on February 25, 2016), Software Development

To migrate a TFS repository to a Visual Studio Team Services Git repository, just perform the following steps: Install the Git command line tools so that the tools are registered in the Windows command prompt Install the Windows package manager Chocolatey Install the command line tool git-tfs with Chocolatey: choco install gittfs Create a local directory for the new Git repository and set the command line’s currect directory to this directory Clone the TFS repository into the local directory: git tfs clone https://[TFSSERVER] $/[REPOSITORYPATH] . --ignore-branches --debug Optionally add .gitignore and .gitattributes files to your Git repository Add the VSO […] Read more...

Tags: , , , , ,


  Page 1 of 1