我现在在一个使用TFS和Git的项目中。我意识到我不能再用叉子了,所以我想问你们,作为解决方案,你们是怎么想的。
我遇到的问题是,我有一个“基本”project.That将被重用到我们的每个客户端。但每个客户都有一定程度的修改(约5-10%)。
我计划将"A“项目转换为"Client_A”,并进行所需的更改。所有可以进行更改的类都是"A“中抽象类的实现,因此只要满足依赖关系,我就能够同步一个新版本的A。
我现在的问题是分叉是不支持的,我们以前在我的团队中使用过bitbucket。但既然我们现在已经和公司其他成员整合了,我们就需要管理其他人正在运行的东西.
这就是我想做的..。
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吗?
发布于 2015-06-03 13:03:47
如果您移除上游遥控器(A),它将无法工作。
也许你想要的东西
# 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 upstreamGit客户端无法在TFS中创建存储库,您需要通过Web接口或使用我的TfsGitAdmin实用程序手动创建存储库。
更新: Fork特性可在VSTS或TFS2018及更高版本中使用(参见https://learn.microsoft.com/en-us/vsts/git/concepts/forks)。
https://stackoverflow.com/questions/30617620
复制相似问题