After import a repo from the github to the VSTS. Is there method let the repo of the VSTS up to data automatically with the github repo?
Best regard.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@moyanming I think you are asking, after importing a repo from GitHub into Azure Repos (new name for repos in Azure DevOps Services), you want to update your Git repo in Azure Repos from the GitHub repo? Kind of like if you had forked your GitHub repo in GitHub?
Hi @steved0x , yes, I want to update my Git repo in Azure Repos from the GitHub repo, like the function of the "Fork" in GitHub. Does the Azure Repos supports this now?
Best regards.
@moyanming
Currently there is no Azure DevOps' build in support for automatically updating your GitHub repo fork in Azure Repos.
I usually do the sync manually on my dev machine.
First, you need to add remote to your local clone from your Azure Repos:
(in this sample, I call the additional remote as upstream)
git remote add upstream <your github .git clone address>
To ensure having the latest github repo's update, always fetch the upstream first:
git fetch upstream
As usual, default branch of github repo is master. Checkout your local master branch, then rebase with the master on your upstream.
Then you should push your changes.
Example:
git checkout master
git rebase upstream/master
git push -f origin
OR you can have a scheduled build using Azure Pipelines, and in the build definition you define a Powershell script that does the steps the same as above:
But adding the remote github repo in the script may require you to sign in and authenticate first to Github, and this is not a simple thing to do.
Because you have to implement OAuth in the Powershell to sign in to Github before you can add remote github repo.
Hi @eriawan
Thank you for your detailed answer. It is useful but seems a little complicated.
Azure Repos should add this feature easily as the GitHub is belong to the Microsoft now.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@steved0x
Please close this issue, because I had answered it on September 2018.
Hi @eriawan
Thank you for your detailed answer. It is useful but seems a little complicated.
Azure Repos should add this feature easily as the GitHub is belong to the Microsoft now.
It isn't supported for azure devops repos fork internally also, is it?
It's no solved, neither azure devops or for github
https://developercommunity.visualstudio.com/idea/365802/allow-option-of-converting-forks-to-repos.html
Most helpful comment
Hi @eriawan
Thank you for your detailed answer. It is useful but seems a little complicated.
Azure Repos should add this feature easily as the GitHub is belong to the Microsoft now.