How to reflect Github and VS Online?

I have my code in a private repository of Github.com as well as in a private replica of Microsoft Visual Studio Online git. Now I want to automatically synchronize / synchronize them. So when I do something on Github, it also pushes VS Online and vice versa.

I know how to do this โ€œclient sideโ€ by adding extra push-remotes to my local repo. But is it possible to do this and the "server side"? Using Github Webhooks or something from Microsoft?

Because otherwise, should I tell everyone who wants to work on the code to add both remotes, or am I mistaken?

+7
git github tfs visual-studio-2015 vsts
source share
2 answers

The only thing we can do right now is use Zapier , which has a free plan. Be that as it may, from what I can find, there is no way to synchronize them together via a web hook or any other means.

I will continue to search for you, and if I find something else, I will update this answer.

+1
source share
  • Add the GitHub service endpoint to your VSTS (Settings> Tools)
  • Create an empty assembly definition in a GitHub repository in VSTS
  • Select the "Repository" tab and select "Connection, repository and default branch." (set Clear to true, clear the source directory)
  • Select the "Triggers" tab and check "Continuous Integration", "Batch Changes" and select "Industry Filters"
  • Select the Options tab and select "Allow scripts to access the OAuth token"

  • Select the Create tab and add a PowerShell task with the following script to synchronize all branches.

git branch -r | findstr /v "\->" | ForEach-Object {$br=$_.TrimStart(); git branch --track $br.TrimStart("origin/") $br} $repoName = "$env:BUILD_REPOSITORY_NAME".split('/')[1] $repoUri = "$env:SYSTEM_TEAMFOUNDATIONCOLLECTIONURI".Substring(8)+ "_git/$repoName" git remote add vsts "https://$env: SYSTEM_ACCESSTOKEN@ $repoUri" git branch -r | findstr /v "\->" | ForEach-Object { $br=$_.TrimStart(" origin/"); git push -u vsts $br }

0
source share

All Articles