Skip to main content

What is patch level in git and composer?

You might have seen the command "patch -p2" or an entry in composer.json when using cweagans/composer-patches like the following.

"patchLevel": {
    "drupal/core": "-p2"
}

In the command "patch -p2," the "-p2" flag specifies the patch level.

The "patch" command is used to apply changes, or patches, to source code files. The "-p" flag followed by a number tells the patch command how many directory levels to strip from the file paths mentioned in the patch file.

Subscribe to Composer
x

Work

Therefore logo
80 Atlantic Ave, Toronto, ON Canada
Email: hello@therefore.ca
Call us: +1 4166405376
Linkedin

Let us know how we can help!