将文件添加到子模块内的超级模块
我昨晚遇到了这个问题。我在 git 中有一个名为 MyApp 的应用程序,在模块文件夹中我有一个名为 Emailq 的子模块。问题是该模块让我在其文件夹内创建一个配置文件。
我希望超级模块能够跟踪该文件,而不是子模块。
这可能吗?
我尝试强制添加文件,但没有成功。
谢谢!
I ran into this issue last night. I have my app in git called MyApp and inside the modules folder I have a submodule called Emailq. The problem is that the module makes me create a config file inside its folder.
I want the supermodule to be able to keep track of that file, not the submodule.
Is that even possible?
I tried to force add the file and it didn't work.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,你不能这样做。
在超级项目中,子模块的路径是一个真实的对象,其中包含应检出的子模块中的提交。它不是一棵树(它称为gitlink),因此您不能在其中放入任何内容。
你也许可以用符号链接来拼凑一些东西;否则,您可能需要考虑使子模块能够引用其自身之外的配置文件。
No, you can't do this.
In the superproject, the path to the submodule is a real object, one which contains the commit in the submodule that should be checked out. It's not a tree (it's called a gitlink), so you can't put any content inside of it.
You might be able to kludge something with a symlink; otherwise, you probably need to look into making the submodule able to refer to config files outside of itself.