patch
A file listing line-by-line changes to source files, and the patch command that applies or reverses them.
In more detail
Patches are produced by diff or git diff and are a common way to share or apply a change to source files. patch -p1 < file applies one, --dry-run shows what would change without touching anything, and -R reverses it.
Examples
patch -p1 --dry-run < breakages/01-missing-404/break.patchgit log --oneline --patch -1 -- parser.pyRelated terms
- fault injection — Deliberately introducing a known bug or failure to check that tests and monitoring detect it.
- diff — A listing of the differences between two versions of something, such as two files, two commits or two screenshots.
- hunk — One block of nearby changed lines in a diff, shown with a few unchanged lines around it for context.
- git show — The command that displays one object in full, usually a commit with its message and patch, or a file as it was in a given commit.
- git add --patch — A way of staging only some of the changes in a file, by answering yes or no to each hunk Git shows you.
Taught in
- HTTP Methods And Status Codes — Modern API Architecture: REST, GraphQL & gRPC
- Caching And Conditional Requests — Modern API Architecture: REST, GraphQL & gRPC
- Contract Testing — Modern API Architecture: REST, GraphQL & gRPC
- What A Commit Really Is — Advanced Git Internals & Distributed Workflows
- Staging Deliberately: status, add, add --patch — Advanced Git Internals & Distributed Workflows
- Conventional Commits — Advanced Git Internals & Distributed Workflows
- Reading History: log, show And diff — Advanced Git Internals & Distributed Workflows
- HEAD, And Why Detached HEAD Is Not An Error — Advanced Git Internals & Distributed Workflows