问题
Here is the scenario I want to implement.
The code of opensource Project-X is maintain by some other party (Party A).
We (Party B) clone Project-X from GitHub (release branch)
Party B do modifications locally
Check-In to VSTS repository.
Do the deployments from VSTS to Azure
So, this is like Party-B only read updates from GitHub and push modifications that they do locally to VSTS (not Github). So actual read/write will take place to VSTS. GitHub will be only use to read changes done by 3rd party.
回答1:
I do this to maintain my theme for my blog. It's maintained by Ghost and I have made modifications. I've blogged about that.
Basically, the trick is to add both VSTS and GitHub as remotes to your local repository:
git remote add github https://github.com/org/project.git
git remote add vsts https://org.visualstudio.com/project/repo.git
Then in your local repository, you can easily merge changes from github into your local repository:
git checkout vsts/master -B master
git fetch github release
git merge github/release -m "Taking latest changes from Github"
git push vsts
This will merge the latest changes into your own project. You may need to resolve conflicts as part of the merge.
This workflow is similar the way you'd resolve a cross repo pull request in GitHub.
来源:https://stackoverflow.com/questions/51905805/visual-studio-clone-from-github-push-to-vsts