So I see this question, and the solution to use franzl/studio. Is there any way I can use "path" for local development, but "vcs" for production environment, without using franzl/studio?
Composer: Is it possible to use path repos locally and vcs repos serverside? (without franzl/studio)
Asked
Active
Viewed 103 times
-1
-
Here is a solution. You can refer the [link](https://stackoverflow.com/questions/29994088/composer-require-local-package). – TripathyC Mar 14 '18 at 13:19
-
1@ChittaranjanTripathy which is the solution? How will composer know to use the "vcs" upon deployment and the "path" in development? – yoho Mar 14 '18 at 13:21
1 Answers
1
First of all why you want different repository type for development and deploy.
If you need the package in both the cases, you can directly use it without putting it in local directory.

TripathyC
- 51
- 5
-
2Basically I need a change in my package to directly reflect in my project, without commiting / pushing and then pulling in my project. I want the same project to be a "path" repository locally, but a "vcs" repository when deploying. How do I achieve this? – yoho Mar 14 '18 at 13:30
-
-
2No no. Let's say I need to update my package. I make the change in the code and I want to see if it works in my project. I don't want to commit / push yet. Then I make it work, I commit / push and I deploy – yoho Mar 14 '18 at 13:44
-
First of all you should not commit the changes to your packages. Only changes to the actual code need to be pushed to git. While deploying if you have a deployment plan, you can add a step for composer update. Which will download all the packages from respective repos. If you want to exclude the vendor folder then edit the .gitignore file and add the location. So that while committing your code changes to vendor folder wont commit. – TripathyC Mar 14 '18 at 13:56
-
2I think you dont understand what I mean. I have a package and a project. The project depends on the package. If I want to do any kind of change of the package, I need to commit and push the change. Then, in the project, I need to pull the changed package. This is tedious. That is why a "path" repository exists in composer. But, unfortunately it cannot be used when deploying. How do I overcome this? – yoho Mar 14 '18 at 14:06