我正在使用composer,并且为了开发,我希望将.git文件夹保留在vendor目录中,以便跟踪区别等等。因此,我的项目结构如下:
projectroot/
.gitignore
file1
file2
vendor/
dir1/
module1/
.git/
module1file1
module1file2
...
dir2/
module2/
.git/
module2file1
...
我想要提交这些文件到Git:
file1
file2
vendor/dir1/module1/module1file1
vendor/dir1/module1/module1file2
vendor/dir2/module2/module2file1
...
我的项目根目录下的.gitignore文件应该是什么?从composer文档中,我尝试了以下内容:
vendor/*.git
and
vendor/*/.git
但是在这两种情况下,git 1.8.3 仍然想将 vendor/dir1/module1
和 vendor/dir2/module2
作为子模块提交,而我想要提交其中的文件。
那么,在这种情况下 .gitignore 语法应该怎样写呢?
vendor/**/.git
? - Sisir