问题描述
假设我有两个仓库, repo A 和 repo B ,其中包含一个代码与repo A中的代码类似的文件夹(实际上并不重要这实际上已经发生了,但是好的,让我们假设我刚刚从A中复制了内容)。
现在我想要以下内容:
因此,基本上,我正在寻找最廉价的方式来获得像逆转稀疏检查一样的东西。
一种方法是建立包含两个项目通用代码的第三个存储库,然后将该存储库用作存储库中的子模块A和B。
然而,如果我理解你的问题,整个A存储库就是通用代码。在这种情况下,不需要在第三个存储库中,您可以简单地将A添加为B中的子模块。
Let's say I have two repos, repo A and repo B, which contains a folder with code similar to the code in repo A (doesn't really matter how this actually has happened, but OK, let's assume I've just copied contents from A).
Now I want following:
- To work just as I got used to in repo A
- To set and additional remote repo pointing to repo B, but pushing and pulling only this subfolder.
- To push, when it needed to this repo B.
So, basically, I'm looking for the cheapest way to have something like reversed sparsed check out.
One approach is to set up 3rd repository containing the code common for both projects, then use that repository as submodule in both repository A and B.
However if I understand your question right, the whole A repository is that "common" code. In that case there's no need in 3rd repository and you can simple add A as a submodule inside B.
这篇关于设置单独的遥控器来推拉仅子文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!