I have a project and I use Git for doing version control in this project. Within this project I have to add a few libraries as dependencies (more specifically PHPUnit and Guzzle). The requirements say that these libraries have to live in a folder of my project and I have to use composer to install/update them.
So I did that and my directory structure looks something like this:
project
|----- .git
|----- libs
|---- guzzle
|---- .git
|---- phpunit
|---- .git
So the guzzle
and phpunit
folders both have a separate .git
folder. This is because, as far as I can tell, composer makes a clone of the master branch from github in order to retrieve the source code of these libraries.
So I did a commit+push on a remote repository. However, when someone else pulls from that repository, the files contained in the libs/guzzle
and libs/phunit
folders do not appear in that person's working directory.
I'm thinking this is because of the 2 .git
folders.
How can I fix this ? I tried searching the documentation of composer for a way to specify in composer.json
to get ONLY the last snapshot so to speak. But I couldn't find anything.
I also thought about deleting the .git
directories, but won't that break everything if I try to do a composer update
in a few months ?
Did anyone have this sort of problem in the past ? How did you solve it ?