Visual Studio Team Services-与Github存储库同步 [英] Visual Studio Team Services - Sync w/ Github Repository

查看:123
本文介绍了Visual Studio Team Services-与Github存储库同步的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Visual Studio Team Services存储库来建立我的公司,并将其与私有Github存储库同步.我们中只有少数人从事技术方面的工作,但有些人喜欢使用VSTS,有些人喜欢使用Github. 各地的文档都说您可以同步两者.这样,在Github中所做的更改将显示在Visual Studio Online中,反之亦然.我正在学习说起来容易做起来难.

I'm attempting to set my company up with a Visual Studio Team Services repository, and sync it with a private Github repo. There are only a handful of us that work on the tech side, but some like to use VSTS and some like to use Github. The documentation everywhere says that you can sync the two. That way changes made in Github will show up in Visual Studio Online, and vice-versa. I'm learning that's easier said than done.

我试图按照Microsoft提供的说明进行操作,但没有找到解决我问题的方法.我可以很容易地克隆现有的Github存储库,但是那里的更改不会同步到VSTS存储库.

I've attempted to follow the directions provided by Microsoft, and have not found any solutions to my problem. I can clone the existing Github repo easily enough, but changes there don't sync to the VSTS repo.

我也尝试了以下说明: 如何在提交时对VSTS和Github存储库进行同步制成 构建通过,它甚至显示了已落实的提交.但是,新文件和/或任何更改根本不会出现在VSTS存储库中.

I tried the following instructions as well: How to synchronize VSTS and Github respositories when commits are made The build passes, and it even shows what commits it has picked up. However new files and/or any changes do not appear in the VSTS repo at all.

有人可以帮忙吗?

推荐答案

从Github存储库同步VSTS存储库的简单方法.

Simple way to sync VSTS repo from Github repo.

  1. GitHub服务终结点添加到您的VSTS(设置">服务")
  2. 在VSTS中使用 GitHub存储库创建一个空的构建定义
  3. 选择存储库标签,然后指定连接",存储库"和默认"分支. (如有必要,将Clean设置为true)
  4. 选择触发器标签,然后选中持续集成,批量更改并指定分支过滤器
  5. 选择选项标签,然后选中允许脚本访问OAuth令牌
  6. 选择 Build 标签,并添加命令行步骤/任务(工具:[Git tool path];参数:push https://$(System.AccessToken)@[xxx].visualstudio.com/[teamproject]/_git/[repo name] HEAD:[branch];工作文件夹:$(Build.SourcesDirectory)
  1. Add GitHub service endpoint to your VSTS (Setting > Service)
  2. Create an Empty build definition with GitHub repository in your VSTS
  3. Select Repository tab and specify Connection, Repository and Default branch. (set Clean to true if necessary)
  4. Select Triggers tab and check Continuous integration, Batch changes and specify Branch filters
  5. Select Options tab and check Allow Scripts to Access OAuth Token
  6. Select Build tab and add Command Line step/task (Tool: [Git tool path]; Arguments: push https://$(System.AccessToken)@[xxx].visualstudio.com/[teamproject]/_git/[repo name] HEAD:[branch]; Working folder: $(Build.SourcesDirectory)

这篇关于Visual Studio Team Services-与Github存储库同步的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆