I'm attempting to set my company up with a Visual Studio Team Services repository, and sync it with a private Github repo. There are only a handful of us that work on the tech side, but some like to use VSTS and some like to use Github. The documentation everywhere says that you can sync the two. That way changes made in Github will show up in Visual Studio Online, and vice-versa. I'm learning that's easier said than done.
I've attempted to follow the directions provided by Microsoft, and have not found any solutions to my problem. I can clone the existing Github repo easily enough, but changes there don't sync to the VSTS repo.
I tried the following instructions as well: How to synchronize VSTS and Github respositories when commits are made The build passes, and it even shows what commits it has picked up. However new files and/or any changes do not appear in the VSTS repo at all.
Can someone please help??
Actually you can use "Git Mirror" from marketplace.
https://marketplace.visualstudio.com/items?itemName=nobitagamer.gitmirror
Simple way to sync VSTS repo from Github repo.
[Git tool path]
; Arguments:push https://$(System.AccessToken)@[xxx].visualstudio.com/[teamproject]/_git/[repo name] HEAD:[branch]
; Working folder:$(Build.SourcesDirectory)
You can do it all in the same directory by adding a second remote origin, if you've already added VSTS as 'origin', then run:
then you can push up your changes you've made to the two repos
to push to VSTS:
and then to push to GitHub
See this github doc page
If you wanted to automate this you might want to set it up as a scheduled task on a machine, or you can get it connected to git hooks on VSTS?