简体   繁体   中英

Visual Studio Clone from Github & push to VSTS

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM