Git子模块和作曲家的澄清 [英] Git submodules and composer clarification
问题描述
我创建了一个php项目。在这个项目下的供应商/我已经包括使用作曲家一些
其他第三方模块。我认为他们带有一个.git文件夹。
最后,我决定在git下添加我的代码。但现在我有问题。一些第三方模块带有.git文件夹,有些没有(idk的原因)。为什么这会发生任何线索?
在我的根文件夹中,我没有任何.gitmodules。
当我做 git status
我得到:
#modified:vendor / somemodule(modified content)
在这种情况下我应该做什么,最好的处理这个问题的方法。我希望仍然可以更新这些库中的更改
,并且还可以跟踪存储库(beanstalk)中的这些模块,这些模块在合并到主分支时将上载到活动服务器。
任何想法,任何阅读链接都会有所帮助。我甚至不知道这是子模块还是不是。
一个图片与我的供应商:
谢谢。
当我执行git status时,我得到:
#modified:vendor / somemodule(修改内容)
这意味着 vendor / somemodule
是一个子模块(请参阅奇怪的图标和损坏后提交)。
但根本问题似乎是作曲家问题,如
一般建议是否定的。
供应商
目录(或者您的依赖关系安装在哪里)应该被添加到.gitignore / svn:ignore / etc $ c
考虑到迄今为止看到的变化似乎并不重要,忽略 vendor
应该是最好的方法。
I have created a php project. In this project under vendor/ I have included using composer some other 3rd party modules. I think they came with a .git folder.
Finally I decided to add my code under git. But now I have problems. Some of this 3rd party modules came with a .git folder some without ( idk the reason ). why this happen any clue ?
In my root folder I have nothing in .gitmodules.
When I do git status
I get:
# modified: vendor/somemodule (modified content)
What should I do in this case, what's the best way to handle this. I want to be able to still be updated about the changes in those libraries and also keep a track of those modules in my repository ( beanstalk ) which when merged to master branch will upload to live server.
Any ideas, any links to read would be helpful. I don't even know if this are submodules or not yet.
an image with my vendor:
Thanks.
The OP Marius.C confirms:
When I do git status I get:
# modified: vendor/somemodule (modified content)
That does mean vendor/somemodule
is a submodule (see "Strange Icon and Entry after corrupt commit").
But the root issue seems to be an issue with composer, as commented by the OP.
Should I commit the dependencies in my vendor directory?
The general recommendation is no. The
vendor
directory (or wherever your dependencies are installed) should be added to.gitignore/svn:ignore/etc
.
Considering the changes seen so far seem to be not important, ignoring vendor
should be the best approach.
这篇关于Git子模块和作曲家的澄清的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!