composer: Add examples of how to pass versions (#1516)

Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
This commit is contained in:
Sumit Pore 2020-08-03 17:38:55 +05:30 committed by GitHub
parent 7a85a431af
commit f2066053f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 0 deletions

View File

@ -55,6 +55,21 @@ This command changes only the `composer.lock` file.
This command changes both the `composer.json` and `composer.lock` files.
### Passing versions
| Command | Description |
| ----------------------------------------------- | ---------------------------------------- |
| `composer require vendor/pkg "1.3.2"` | Installs `1.3.2` |
| `composer require vendor/pkg ">=1.3.2"` | Above or equal `1.3.2` |
| `composer require vendor/pkg "<1.3.2"` | Below `1.3.2` |
| `composer require vendor/pkg "1.3.*"` | Latest of `>=1.3.0 <1.4.0` |
| `composer require vendor/pkg "~1.3.2"` | Latest of `>=1.3.2 <1.4.0` |
| `composer require vendor/pkg "~1.3"` | Latest of `>=1.3.0 <2.0.0` |
| `composer require vendor/pkg "^1.3.2"` | Latest of `>=1.3.2 <2.0.0` |
| `composer require vendor/pkg "^1.3"` | Latest of `>=1.3.0 <2.0.0` |
| `composer require vendor/pkg "^0.3.2"` | Latest of `>=0.3.0 <0.4.0` (for pre-1.0) |
| `composer require vendor/pkg "dev-BRANCH_NAME"` | From the branch `BRANCH_NAME` |
### Removing packages
| Command | Description |