我可以在一个git-ignored文件夹中有一个嵌套的git仓库吗? [英] Can I have a nested git repo inside a git-ignored folder?
问题描述
我有一个有以下文件夹的git repo:
I have a git repo which have following folders:
_includes/
_layouts/
_plugins/
_posts/
_site/
_site文件夹被添加到 file。
_site folder is added in the .gitignore
file.
现在,我可以在_site文件夹内使用不同的远程回购进行push和pull的git回购?会不会有冲突?
Now can I have a git repo inside _site folder with different remote repo for push and pull? Will there be any conflict?
我研究过git子模块,但是我认为如果上述方法可行,我认为这对我来说会是一种矫枉过正。
I have studied git submodules but I think it would be a overkill in my case, if the above stated method can work.
推荐答案
我认为它应该有效。对于主回购, _site
文件夹不存在。所以你在里面有什么并不重要。当你 cd
转换为 _site
时,你将会进入这个独立的回购站。
I think it should work. For main repo, _site
folder does not exists. So what you have inside it doesn't matter. When you cd
into _site
you will be on that independent repo.
这篇关于我可以在一个git-ignored文件夹中有一个嵌套的git仓库吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!