首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用TFS Git进行分叉

使用TFS Git进行分叉
EN

Stack Overflow用户
提问于 2015-06-03 10:33:39
回答 1查看 4.2K关注 0票数 7

我现在在一个使用TFS和Git的项目中。我意识到我不能再用叉子了,所以我想问你们,作为解决方案,你们是怎么想的。

我遇到的问题是,我有一个“基本”project.That将被重用到我们的每个客户端。但每个客户都有一定程度的修改(约5-10%)。

我计划将"A“项目转换为"Client_A”,并进行所需的更改。所有可以进行更改的类都是"A“中抽象类的实现,因此只要满足依赖关系,我就能够同步一个新版本的A。

我现在的问题是分叉是不支持的,我们以前在我的团队中使用过bitbucket。但既然我们现在已经和公司其他成员整合了,我们就需要管理其他人正在运行的东西.

这就是我想做的..。

代码语言:javascript
复制
git clone http://mycompany.com/tfs/MyDefaultCollection/My Git Projects/_git/A
cd A
git fetch origin
git branch -a
git checkout -b a_branch1 origin/a_branch1
git checkout -b a_branch2 origin/a_branch2
git checkout -b a_branchN origin/a_branchN
git branch -a
git remote add new-origin http://mycompany.com/tfs/MyDefaultCollection/My Git Projects/_git/Client_A
git push --all new-origin
git push --tags new-origin
git remote rm origin
git remote rename new-origin origin

如果我这样做,我还能上游到A吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-06-03 13:03:47

如果您移除上游遥控器(A),它将无法工作。

也许你想要的东西

代码语言:javascript
复制
# 1. create Client_A repo in TFS
# 2. get A repo locally
git clone http://mycompany.com/tfs/MyDefaultCollection/My Git Projects/_git/A
cd A
# 3. redefine remotes
git remote rename origin upstream
git remote add origin http://mycompany.com/tfs/MyDefaultCollection/My Git Projects/_git/Client_A
# 4. push to Client A
git push origin
# 5. push to A (when proper)
git push upstream

Git客户端无法在TFS中创建存储库,您需要通过Web接口或使用我的TfsGitAdmin实用程序手动创建存储库。

更新: Fork特性可在VSTS或TFS2018及更高版本中使用(参见https://learn.microsoft.com/en-us/vsts/git/concepts/forks)。

票数 10
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30617620

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档