Git Patch and Email Workflows/Format commit range

Generate patches for commits not yet upstream.

Section: Create Patch Series

Format commit range

bash
bash
git format-patch origin/main..HEAD

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Create Patch Series
Format last commit
Generate one patch file from latest commit.
OpenIn sheetbashsame section
Format with cover letter
Generate last 3 commits plus cover letter template.
OpenIn sheetbashsame section
Format threaded series
Prepare patches for email threading.
OpenIn sheetbashsame section
Check patch applicability
Validate patch without modifying files.
OpenIn sheetbash1 tag match
Range-diff two series
Review changes between patch series revisions.
OpenIn sheetbash1 tag match
Apply patch and update index
Apply patch to working tree and index.
OpenIn sheetbash1 tag match