A patch is a specially-formatted file (usually created by the ‘diff’ command) that describes the differences between two files, or, more usefully in this context, the differences between two versions of the same file. A patch is usually the preferred method of sending code changes to the maintainer of software projects.