Blog: Git

Script to clone all Git repositories from your VSTS collection

August 23, 2016, 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: , , , , ,

Merging a Pull Request in Visual Studio

November 21, 2014, (updated on January 12, 2015), Software Development

Recently I tried to merge a Pull Request from CodePlex directly in Visual Studio. However, if the Pull Request comes from a forked repository, there is no way around using the command line tools to pull the remote branch into a local branch. It is actually very simple; just perform the following steps. Pull the changes Note: If the Pull Request’s branch is in the same repository, you can simply press on New Branch… in Visual Studio and select the appropriate branch in the drop down list. In this case you don’t need to do the next three steps. In […] Read more...

Tags: , , , , , ,


  Page 1 of 1