Patch verification workflow¶
The Patch verification workflow is a process used to test patch files before applying them permanently to a Git repository. This procedure ensures that the generated patches are valid and that they can be integrated into the target codebase without errors.^[600-developer__tools__git__git-patch-cherry-pick.md]
Workflow Steps¶
Once a patch file is generated using git format-patch and moved to the target Git directory, the following steps are used to verify its contents and viability.^[600-developer__tools__git__git-patch-cherry-pick.md]
- Inspect patch statistics: To see which files will be modified and the extent of the changes without applying them, run
git apply --stat <patch-file>.^[600-developer__tools__git__git-patch-cherry-pick.md] - Check for errors: To perform a dry run and verify if the patch can be applied cleanly, use
git apply --check <patch-file>.^[600-developer__tools__git__git-patch-cherry-pick.md] - Apply the patch: If the check is successful, the patch can be applied using
git am -s < <patch-file>.^[600-developer__tools__git__git-patch-cherry-pick.md]
Related Concepts¶
- [[Git]]
- [[Cherry-pick]]
Sources¶
^[600-developer__tools__git__git-patch-cherry-pick.md]