I am new to VSTS and trying to sync my Github repos to the VSTS environment to completely integrate my working environment to it. I want to sync my Github repos to update whatever changes made on VSTS. This procedure is very confusing.
I followed this link: http://intranoggin.com/Blog/February-2017/Synchronizing-code-between-GitHub-and-VSTS.aspx
The new interface does not totally reflect the tutorial, but I was able to follow most parts. I did the followings:
I create a new definition of Builds
link it to my github repo
set access tokens
set task commands just as stated in the tutorial link above
save the definition and create a queue that runs the task
This worked well when I made changes a single branch in Github.
But what I am trying to do eventually is:
I want it to sync with the Repo itself including all Branches. So, if I create a new branch for Pull Request, I want it to get applied to VSTS automatically.
I really need help from someone who already has been using VSTS and knows how to make a complete Sync with Github repos and VSTS
If you always make changes on VSTS git repo and need to sync github repo correspondingly, then you can use one VSTS CI build definition to achieve it. Detail steps as below:
Enable continuous integration andspecify include all branches for Branch filters:
Add the powershell script for PowerShell task as below:
Make sure Fail on Standard Error option for PowerShell task is deselected:
Now after any changes is made on the VSTS git repo, github repo will be updated automatically.
If you want to build on every branch with VSTS, you need to edit the build definition and then set up an appropriate trigger. This way, builds will happen automatically instead of having to manually queue them.
The official Microsoft documentation on this is pretty good and goes into more detail.