I would like to know what each one does and / or if there is a difference between
both.
These options refer to how the composer will download and manage the dependencies within your vendor directory.
--prefer-dist
will give preference to the distribution package of that dependency if available. This is the default option if you are referencing in your composer.json a stable version of that package.
For example, when creating a tag and a release within a GitHub repository. This tag will have a corresponding zip for that version and from that zip the composer will install its dependency. This option is the fastest to install.
--prefer-source
will give preference to downloading the source code repository itself, making a git clone
of that repository. This option is interesting if you are working with a developing package and want to update the content with vendor later. It is slower because in addition to the application code, the project repository is also downloaded.
More information can be found at composer documentation at .