Question

I have a private bundle that I import in the vendor.

Now, I'm working in my project and want to edit some code in the vendor bundle.

Now I've done that and want to commit to code, so I go the dir of that bundle and say: "git commit -a" so I give a message, save and now I have a commit. Oke, "git push" and give the response "Everything is up-to-date"... So I can't push that but I can commit??

Is this not a way to commit? Should I just clone the repo and work there?

Was it helpful?

Solution 3

Its a long time ago that I asked this question. Mean while I got the answer but never updated my stackoverflow question, sorry for that!

The answer on my own question is to get the dependency with composer --prefer-source.

https://getcomposer.org/doc/03-cli.md#install

--prefer-source: There are two ways of downloading a package: source and dist. For stable versions composer will use the dist by default. The source is a version control repository. If --prefer-source is enabled, composer will install from source if there is one. This is useful if you want to make a bugfix to a project and get a local git clone of the dependency directly.

OTHER TIPS

You should never edit the vendor code directly - this is the whole point of dependency management.

Composer basically works by looking at your composer.json file, and fetching the repositories and versions you specify. If you need to make changes to one of your dependencies, you should make the change in the original repository, push the changes up to GitHub (or wherever you're hosting the code) and run composer update.

When Composer installs a vendor, it checks out a particular commit, so you are not on a branch. You need to checkout the master branch — or whichever you're using — and commit to it and push it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top