Visual Studio Clone from Github & push to VSTS

筅森魡賤 提交于 2019-12-23 03:22:07

问题


Here is the scenario I want to implement.

  1. The code of opensource Project-X is maintain by some other party (Party A).

  2. We (Party B) clone Project-X from GitHub (release branch)

  3. Party B do modifications locally

  4. Check-In to VSTS repository.

  5. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!