在Github上指定一个非Github仓库作为远程仓库 [英] Designate a non-Github repo as a remote on Github

查看:131
本文介绍了在Github上指定一个非Github仓库作为远程仓库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在企业Github和企业TFS之间同步存储库。 TFS UI不支持服务器上的远程存储库。



有没有一种方法可以将GFS中的git仓库指定为Github上的远程仓库?我知道我可以通过一个本地repo进行同步,这个repo会列出两个都是远程的,但是这可以在没有本地的情况下完成? 解决方案

不幸的是,没有这样的官方工具或服务。您必须像上面提到的那样通过本地回购来手动执行同步。


如果您在TFS中使用Git存储库,那么您可以在本地Git存储库中创建设置
两个远程

  git remote add upstream https://github.com/foo/bar.git 
git remote add origin https :// tfsserver / DefaultCollection / _git / bar

然后简单地执行 git pull upstream master后面跟着一个 git push
原点大师假设master是您想要保留的分支
同步。

使用任一版本控制系统,您可能希望在版本控制中保留一个分支
到您的TFS存储库中,以匹配$ b中的内容$ b上游的GitHub项目,以便您可以轻松看到
变化进入一个地方,然后在您的本地
存储库中处理您的合并。


源链接:
将Github代码集成到TFS中 - 自动签入

另一个解决方法是借助TFS中的特殊构建,然后在构建管道期间调用git命令。详细步骤请参阅此博客:让Git存储库在VSTS / TFS和Git之间保持同步。您也可以在市场中使用 Git Tasks



另请参阅本文:在我的GitHub和Visual Studio Online之间进行同步



您也可以提交用户语音来建议本网站的功能: a href =https://visualstudio.uservoice.com/forums/330519-team-services =nofollow noreferrer> https://visualstudio.uservoice.com/forums/330519-team-services

I'd like to sync a repository between a corporate Github and a corporate TFS. TFS UI don't support remote repositories on the server.

Is there a way to designate the git repo within TFS as a remote on Github? I know I can sync via a local repo that would list both as remotes, but can this be done without a local one?

解决方案

Unfortunately, there isn't such an official tool or services. You have to manually do the sync via a local repo as you mentioned.

If you are using a Git repository in TFS then you can create set up two remotes in a local Git repository, i.e

git remote add upstream https://github.com/foo/bar.git
git remote add origin https://tfsserver/DefaultCollection/_git/bar

And then simply do a git pull upstream master followed by a git push origin master assuming that master is the branch that you want to keep in sync.

With either version control system, you probably want to keep a branch in version control in your TFS repository to match what is in your upstream GitHub project so that you can easily see change coming in the one place and then handle your merges inside your local repository.

Source Link: Integrating Github code to TFS - auto check-in

Another workaround is with help of a special build in TFS, then calling git command during the build pipeline. Detail steps please refer this blog: Keep Git repository in sync between VSTS / TFS and Git. You could also use the Git Tasks in marketplace.

Also reference this article : Sync between my GitHub and Visual Studio Online

You can also submit a user voice to suggest the feature on this site: https://visualstudio.uservoice.com/forums/330519-team-services

这篇关于在Github上指定一个非Github仓库作为远程仓库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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