Reputation: 2736
I'm developing a composer package used in another application. The package resides in a separate repository. Every now and then when I fix something in the package during the development, I have to increment its version by assigning a git tag so that the application where the package is used can download the latest version of it. I end up having lots of tags.
Is there a more appropriate way allowing to update (the composer update cmd) the package under development in the app where it's used without using thousands of tags?
Say I change the package, commit and push the changes to the repo. When I do composer update in the app's scope, it updates the package, although it's version is not incremented with the last change, there are only new commits in the package's repo.
Upvotes: 0
Views: 715
Reputation: 38106
Usually there are two ways to update packages by composer update: tags and branches. Since you don’t want to use tags, let’s only talk branches here.
Such as, if you are working on master
branch, and want the changes from master
branch can be installed in your app, you need to change the dependencies of the package in composer.json
as
{
"require": {
"vendor/package": "dev-master"
}
}
More detail, you can refer versions.
Upvotes: 1
Reputation: 70863
What is bad with having a lot of tags?
You can depend on branches. Composer would clone the repository and checkout the latest commit of that branch every time you run update. I highly recommend to depend on a branch using a version alias: "your/lib": "dev-feature as 2.2.0"
- this will fulfill dependencies of other libs that require this one in a certain version, and it makes it clearer which version this branch is based on.
Upvotes: 2