Patch

A patch file (or patch file) is a text file with a .patch extension that includes a set of formatted code extracted using the git diff command, for example. Using a patch file allows you to change the core code, module, or theme to fix bugs, optimize performance, change, or add new features. Patches make development easier because instead of providing a replacement file of thousands of lines of code, the patch file includes only those changes.

Good practices of the patch file in Drupal