send-email Git Command Guide
The git send-email command sends commits and patches via email, enabling distributed development workflows where contributors submit changes through email-based patch review systems. It’s commonly used in open source projects that use mailing lists for code review and contribution management.
git send-email Syntax:
Section titled “git send-email Syntax:”git send-email [<options>] [<files> | <directories> | <rev-list options>...]git send-email --dump-aliases [<options>]Email Configuration Options:
Section titled “Email Configuration Options:”| Option | Description |
|---|---|
--to=<address> | Primary recipient email address |
--cc=<address> | Carbon copy recipient |
--bcc=<address> | Blind carbon copy recipient |
--from=<address> | Sender email address |
--reply-to=<address> | Reply-to address |
--in-reply-to=<id> | Message ID to reply to |
--subject=<text> | Email subject prefix |
SMTP Configuration Options:
Section titled “SMTP Configuration Options:”| Option | Description |
|---|---|
--smtp-server=<host> | SMTP server hostname |
--smtp-port=<port> | SMTP server port (default: 25/587) |
--smtp-encryption=<encryption> | Encryption: ssl/tls/none |
--smtp-user=<user> | SMTP authentication username |
--smtp-pass=<password> | SMTP authentication password |
--smtp-server-option=<option> | Additional SMTP options |
Content Control Options:
Section titled “Content Control Options:”| Option | Description |
|---|---|
--compose | Open editor to compose cover letter |
--compose-encoding=<encoding> | Encoding for compose message |
--subject-prefix=<prefix> | Subject prefix (default: PATCH) |
--numbered | Use numbered patches |
--no-numbered | Don’t use numbered patches |
--reroll-count=<n> | Mark as reroll version |
--notes[=<ref>] | Include notes in emails |
Patch Control Options:
Section titled “Patch Control Options:”| Option | Description |
|---|---|
--thread | Enable message threading |
--no-thread | Disable message threading |
--chain-reply-to | Chain replies to previous message |
--no-chain-reply-to | Don’t chain replies |
--cover-letter | Generate cover letter |
--no-cover-letter | Don’t generate cover letter |
--cover-from-description=<mode> | Generate cover from branch description |
Output Control Options:
Section titled “Output Control Options:”| Option | Description |
|---|---|
--dry-run | Show what would be sent without sending |
--quiet | Suppress output |
--verbose | Verbose output |
--validate | Validate patches before sending |
--format-patch | Generate patches without sending |
Advanced Options:
Section titled “Advanced Options:”| Option | Description |
|---|---|
--batch-size=<n> | Send in batches |
--relogin-delay=<n> | Delay between login attempts |
--suppress-cc=<category> | Suppress CC for categories |
--confirm=<mode> | Confirmation mode |
--dump-aliases | Dump configured aliases |
Parameters:
Section titled “Parameters:”| Parameter | Description |
|---|---|
<files> | Patch files to send |
<directories> | Directories containing patches |
<rev-list options> | Revision range for patches |
Understanding Send-Email Concepts:
Section titled “Understanding Send-Email Concepts:”Email-Based Workflow:
Section titled “Email-Based Workflow:”Traditional Git Workflow:├── Push: Direct to repository├── Pull Request: Web-based review├── Merge: Web interface
Email-Based Workflow:├── Format-patch: Create patch files├── Send-email: Submit via email├── Review: Mailing list discussion├── Apply: Manual patch application└── Merge: Repository maintainerPatch Series Structure:
Section titled “Patch Series Structure:”Patch Series Email Thread:├── [PATCH 0/5] Cover letter (optional)│ ├── Introduction and overview│ ├── Changes summary│ └── Testing information├── [PATCH 1/5] First patch│ ├── Commit message│ └── Diff content├── [PATCH 2/5] Second patch│ └── ...└── [PATCH 5/5] Final patchMailing List Integration:
Section titled “Mailing List Integration:”Mailing List Workflow:├── Contributor: git send-email├── Mailing List: Distributes patches├── Reviewers: Reply with comments├── Contributor: Send v2 patches├── Maintainers: Apply approved patches└── Repository: Updated with changesBasic Send-Email Operations:
Section titled “Basic Send-Email Operations:”Sending Patches:
Section titled “Sending Patches:”# Send patches from commit rangegit send-email --to=maintainer@example.com origin/main..HEAD
# Send specific patch filesgit send-email --to=reviewer@example.com 0001-patch.patch 0002-patch.patch
# Send with cover lettergit send-email --cover-letter --to=list@example.com origin/main..feature-branchConfiguration Setup:
Section titled “Configuration Setup:”# Configure SMTP settingsgit config sendemail.smtpServer smtp.example.comgit config sendemail.smtpPort 587git config sendemail.smtpEncryption tlsgit config sendemail.smtpUser your-email@example.com
# Configure email addressesgit config sendemail.to maintainer@example.comgit config sendemail.cc reviewer@example.com
# Configure identitygit config sendemail.from "Your Name <your-email@example.com>"Patch Preparation:
Section titled “Patch Preparation:”# Generate patches for sendinggit format-patch -o patches/ origin/main..HEAD
# Send generated patchesgit send-email --to=list@example.com patches/
# Send with threadinggit send-email --thread --to=list@example.com patches/Advanced Send-Email Scenarios:
Section titled “Advanced Send-Email Scenarios:”Cover Letter Creation:
Section titled “Cover Letter Creation:”# Create cover letter interactivelygit send-email --compose --to=list@example.com patches/
# Generate cover letter from branch descriptiongit send-email --cover-from-description=branch --to=list@example.com origin/main..HEAD
# Custom cover letter contentgit send-email --cover-letter --annotate --to=list@example.com patches/SMTP Authentication:
Section titled “SMTP Authentication:”# Gmail SMTP configurationgit config sendemail.smtpServer smtp.gmail.comgit config sendemail.smtpPort 587git config sendemail.smtpEncryption tlsgit config sendemail.smtpUser your-gmail@gmail.com
# OAuth2 authentication (advanced)git config sendemail.smtpAuth oauthbearergit config sendemail.smtpOAuthRefreshToken <token>Mailing List Workflows:
Section titled “Mailing List Workflows:”# Send to kernel mailing listgit send-email --to=linux-kernel@vger.kernel.org --cc=maintainer@example.com patches/
# Send with proper threadinggit send-email --thread --chain-reply-to --to=list@example.com patches/
# Send reroll versiongit send-email --reroll-count=2 --to=list@example.com patches/Batch Sending:
Section titled “Batch Sending:”# Send in batches to avoid spam filtersgit send-email --batch-size=5 --to=list@example.com patches/
# Send with delaysgit send-email --relogin-delay=5 --to=list@example.com patches/Configuration and Best Practices:
Section titled “Configuration and Best Practices:”Git Configuration for Send-Email:
Section titled “Git Configuration for Send-Email:”# Basic email configurationgit config sendemail.to "project-maintainer@example.com"git config sendemail.cc "project-reviewers@example.com"git config sendemail.from "Your Name <your-email@example.com>"
# SMTP configurationgit config sendemail.smtpServer "smtp.company.com"git config sendemail.smtpPort 587git config sendemail.smtpEncryption tlsgit config sendemail.smtpUser "your-username"
# Advanced optionsgit config sendemail.confirm alwaysgit config sendemail.thread yesgit config sendemail.chainReplyTo yesgit config sendemail.suppressCc selfSend-Email Best Practices:
Section titled “Send-Email Best Practices:”# Always use cover letters for multi-patch seriesgit send-email --cover-letter --to=list@example.com patches/
# Use descriptive subjectsgit send-email --subject-prefix="RFC:" --to=list@example.com patches/
# Test with dry-run firstgit send-email --dry-run --to=your-email@example.com patches/
# Use proper threadinggit send-email --thread --to=list@example.com patches/Safe Send-Email Operations:
Section titled “Safe Send-Email Operations:”# Validate before sendinggit send-email --validate --dry-run patches/
# Check configurationgit config --list | grep sendemail
# Test SMTP connectiongit send-email --dry-run --to=your-email@example.com --smtp-debug patches/Integration with Development Workflows:
Section titled “Integration with Development Workflows:”Open Source Contribution Workflow:
Section titled “Open Source Contribution Workflow:”#!/bin/bash# Open source contribution workflow
prepare_contribution() { local branch="$1" local maintainer_email="$2"
echo "Preparing contribution from branch: $branch"
# Create patch series git format-patch -o patches/ --cover-letter --subject-prefix="PATCH" origin/main.."$branch"
# Edit cover letter ${EDITOR:-nano} patches/0000-cover-letter.patch
# Send patches git send-email --to="$maintainer_email" --cc="contributors@example.com" patches/
echo "Patches sent for review"}
# Usageprepare_contribution "feature/new-api" "maintainer@project.org"Kernel Development Workflow:
Section titled “Kernel Development Workflow:”# Kernel-style patch submissionkernel_contribution() { local subsystem="$1" local maintainer="$2"
echo "Preparing kernel contribution for $subsystem"
# Generate patches with proper formatting git format-patch --subject-prefix="PATCH $subsystem" -o patches/ origin/main..HEAD
# Check patch quality for patch in patches/*.patch; do if ! scripts/checkpatch.pl "$patch"; then echo "Patch $patch failed checkpatch" exit 1 fi done
# Send to mailing list git send-email --to="$maintainer" --cc="linux-kernel@vger.kernel.org" patches/
echo "Kernel patches submitted"}
kernel_contribution "net" "netdev@vger.kernel.org"Corporate Review Workflow:
Section titled “Corporate Review Workflow:”# Corporate code review workflowcorporate_review() { local reviewers="$1" local project="$2"
echo "Starting corporate review for $project"
# Generate patches git format-patch --cover-letter -o review/ --subject-prefix="REVIEW $project" origin/develop..HEAD
# Add review metadata echo "Reviewers: $reviewers" >> review/0000-cover-letter.patch echo "Project: $project" >> review/0000-cover-letter.patch echo "Testing: Unit tests pass, integration tests pending" >> review/0000-cover-letter.patch
# Send for review git send-email --to="$reviewers" --cc="team@example.com" review/
echo "Review patches sent"}
corporate_review "senior-dev@example.com,architect@example.com" "user-authentication"Troubleshooting Common Issues:
Section titled “Troubleshooting Common Issues:”SMTP Authentication Issues:
Section titled “SMTP Authentication Issues:”# Test SMTP connectiongit send-email --smtp-debug --dry-run --to=your-email@example.com patches/
# Check SMTP settingsgit config --list | grep smtp
# Use different encryptiongit config sendemail.smtpEncryption ssl # Try ssl instead of tlsEmail Delivery Issues:
Section titled “Email Delivery Issues:”# Check email formatgit send-email --validate --dry-run patches/
# Use batch sendinggit send-email --batch-size=1 --relogin-delay=10 --to=list@example.com patches/
# Check spam filters# Add subject prefix, avoid attachments, use plain textPatch Format Issues:
Section titled “Patch Format Issues:”# Validate patch formatgit apply --check patches/*.patch
# Fix whitespace issuesgit format-patch --whitespace=fix -o patches/ origin/main..HEAD
# Regenerate patchesrm -rf patches/git format-patch --cover-letter -o patches/ origin/main..HEADMailing List Configuration:
Section titled “Mailing List Configuration:”# Configure for specific mailing listgit config sendemail.to "list@example.com"git config sendemail.cc "contributors@example.com,maintainers@example.com"
# Use aliases for common lists# Add to ~/.gitconfig[sendemail "aliases"] kernel = linux-kernel@vger.kernel.org git = git@vger.kernel.orgCharacter Encoding Issues:
Section titled “Character Encoding Issues:”# Fix encoding problemsgit config sendemail.assume8bitEncoding true
# Set proper encodinggit config i18n.commitEncoding UTF-8git config sendemail.composeEncoding UTF-8
# Handle special charactersexport LC_ALL=C.UTF-8Threading Issues:
Section titled “Threading Issues:”# Fix threading problemsgit send-email --thread --chain-reply-to --to=list@example.com patches/
# Check message IDsgit send-email --dry-run --verbose patches/ | grep -i message-id
# Manual threadinggit send-email --in-reply-to="<message-id>" --to=list@example.com patches/Real-World Usage Examples:
Section titled “Real-World Usage Examples:”Open Source Project Contribution:
Section titled “Open Source Project Contribution:”#!/bin/bash# Complete open source contribution workflow
opensource_contribution() { echo "=== Open Source Contribution Workflow ==="
# Setup contribution environment setup_contribution() { local project="$1" local upstream_remote="$2"
echo "Setting up contribution for $project"
# Add upstream remote if not exists if ! git remote get-url "$upstream_remote" >/dev/null 2>&1; then echo "Add upstream remote: $upstream_remote" git remote add upstream "https://github.com/$project.git" fi
# Fetch latest changes git fetch upstream
# Configure send-email for the project case "$project" in "torvalds/linux") git config sendemail.to "linux-kernel@vger.kernel.org" git config sendemail.cc "linux-kernel@vger.kernel.org" ;; "git/git") git config sendemail.to "git@vger.kernel.org" ;; *) read -p "Enter mailing list address: " mailing_list git config sendemail.to "$mailing_list" ;; esac
echo "Contribution environment ready" }
# Create and send patches send_patches() { local branch="$1" local version="${2:-1}"
echo "Creating patches from branch: $branch (v$version)"
# Create patch directory patch_dir="patches-v$version" mkdir -p "$patch_dir"
# Generate patches if [ "$version" -eq 1 ]; then git format-patch --cover-letter -o "$patch_dir" --subject-prefix="PATCH" upstream/main.."$branch" else git format-patch --cover-letter -o "$patch_dir" --subject-prefix="PATCH v$version" upstream/main.."$branch" fi
# Edit cover letter if [ -f "$patch_dir/0000-cover-letter.patch" ]; then echo "Edit cover letter with ${EDITOR:-nano}" ${EDITOR:-nano} "$patch_dir/0000-cover-letter.patch" fi
# Validate patches echo "Validating patches..." for patch in "$patch_dir"/*.patch; do if ! git apply --check "$patch" >/dev/null 2>&1; then echo "ERROR: Invalid patch: $patch" return 1 fi done
# Send patches echo "Sending patches..." git send-email --dry-run --confirm=always "$patch_dir"
read -p "Send patches? (y/N): " confirm if [[ "$confirm" == "y" ]]; then git send-email --thread --chain-reply-to "$patch_dir" echo "Patches sent successfully" else echo "Patches not sent" fi }
# Handle review feedback handle_feedback() { local original_branch="$1" local feedback_version="$2"
echo "Handling review feedback for $original_branch"
# Create feedback branch feedback_branch="${original_branch}-v${feedback_version}" git checkout -b "$feedback_branch" "$original_branch"
echo "Created branch: $feedback_branch" echo "Address review comments and run:" echo " send_patches $feedback_branch $feedback_version" }
# Interactive workflow echo "Open Source Contribution Options:" echo "1. Setup contribution environment" echo "2. Send patches" echo "3. Handle review feedback"
read -p "Select option (1-3): " option
case "$option" in 1) read -p "Project (user/repo): " project read -p "Upstream remote name: " upstream setup_contribution "$project" "$upstream" ;; 2) read -p "Branch to send: " branch read -p "Version number (default: 1): " version version="${version:-1}" send_patches "$branch" "$version" ;; 3) read -p "Original branch: " original read -p "Feedback version: " feedback_ver handle_feedback "$original" "$feedback_ver" ;; *) echo "Invalid option" ;; esac}
opensource_contributionCorporate Development Workflow:
Section titled “Corporate Development Workflow:”# Corporate patch review workflowcorporate_workflow() { echo "=== Corporate Patch Review Workflow ==="
# Setup corporate email configuration setup_corporate_email() { echo "Setting up corporate email configuration"
# SMTP configuration git config sendemail.smtpServer "smtp.company.com" git config sendemail.smtpPort 587 git config sendemail.smtpEncryption tls git config sendemail.smtpUser "$(git config user.email)"
# Corporate aliases git config sendemail.aliases "corporate=team@company.com,managers=mgr@company.com"
echo "Corporate email configured" }
# Send code review send_code_review() { local branch="$1" local reviewers="$2" local project="$3"
echo "Sending code review for $project"
# Create review patches review_dir="review-$(date +%Y%m%d)" mkdir -p "$review_dir"
git format-patch --cover-letter -o "$review_dir" --subject-prefix="REVIEW $project" origin/main.."$branch"
# Add review metadata cat >> "$review_dir/0000-cover-letter.patch" << EOF
Review Information:- Reviewers: $reviewers- Project: $project- Branch: $branch- Commits: $(git rev-list --count origin/main.."$branch")
Testing Status:- [ ] Unit tests pass- [ ] Integration tests pass- [ ] Code review complete- [ ] Security review complete
Checklist:- [ ] Coding standards followed- [ ] Documentation updated- [ ] Breaking changes identified- [ ] Performance impact assessedEOF
# Send review git send-email --to="$reviewers" --cc="team@company.com" --thread "$review_dir"
echo "Code review sent" }
# Send release patches send_release_patches() { local version="$1" local release_notes="$2"
echo "Sending release patches for v$version"
# Create release patches release_dir="release-v$version" mkdir -p "$release_dir"
git format-patch --no-cover-letter -o "$release_dir" --subject-prefix="RELEASE v$version" "v$(($version-1))..HEAD"
# Add release notes if [ -f "$release_notes" ]; then cp "$release_notes" "$release_dir/RELEASE_NOTES.txt" fi
# Send release git send-email --to="releases@company.com" --cc="all@company.com" "$release_dir"
echo "Release patches sent" }
# Interactive corporate workflow echo "Corporate Workflow Options:" echo "1. Setup corporate email" echo "2. Send code review" echo "3. Send release patches"
read -p "Select option (1-3): " option
case "$option" in 1) setup_corporate_email ;; 2) read -p "Branch: " branch read -p "Reviewers (comma-separated): " reviewers read -p "Project: " project send_code_review "$branch" "$reviewers" "$project" ;; 3) read -p "Version: " version read -p "Release notes file: " notes send_release_patches "$version" "$notes" ;; *) echo "Invalid option" ;; esac}
corporate_workflowAcademic Collaboration Workflow:
Section titled “Academic Collaboration Workflow:”# Academic research collaborationacademic_collaboration() { echo "=== Academic Collaboration Workflow ==="
# Setup research group communication setup_research_group() { local group_email="$1"
echo "Setting up research group communication"
git config sendemail.to "$group_email" git config sendemail.cc "supervisor@university.edu"
# Configure for academic SMTP git config sendemail.smtpServer "smtp.university.edu" git config sendemail.smtpPort 587 git config sendemail.smtpEncryption tls
echo "Research group communication configured" }
# Send research patches send_research_patches() { local experiment="$1" local collaborators="$2"
echo "Sending research patches for $experiment"
# Create research patches research_dir="research-$(date +%Y%m%d)" mkdir -p "$research_dir"
git format-patch --cover-letter -o "$research_dir" --subject-prefix="RESEARCH $experiment" origin/main..HEAD
# Add research metadata cat >> "$research_dir/0000-cover-letter.patch" << EOF
Research Information:- Experiment: $experiment- Collaborators: $collaborators- Date: $(date)- Repository: $(git remote get-url origin)
Methodology:- [ ] Experimental design sound- [ ] Data collection complete- [ ] Statistical analysis performed- [ ] Results validated
Peer Review Checklist:- [ ] Code review complete- [ ] Methodology review complete- [ ] Results review complete- [ ] Publication readyEOF
# Send to research group git send-email --to="$collaborators" --cc="research-group@university.edu" --thread "$research_dir"
echo "Research patches sent for review" }
# Send publication patches send_publication_patches() { local paper_title="$1" local journal="$2"
echo "Preparing patches for publication: $paper_title"
# Create publication patches pub_dir="publication-$(date +%Y%m%d)" mkdir -p "$pub_dir"
git format-patch --cover-letter -o "$pub_dir" --subject-prefix="PUBLICATION" origin/main..HEAD
# Add publication metadata cat >> "$pub_dir/0000-cover-letter.patch" << EOF
Publication Information:- Title: $paper_title- Journal: $journal- Submission Date: $(date)- Authors: $(git shortlog --no-merges --email --summary | head -5 | cut -d' ' -f2)
Code Availability:- Repository: $(git remote get-url origin)- Version: $(git describe --tags)- License: MIT
Reproducibility:- [ ] Code runs on clean environment- [ ] Dependencies documented- [ ] Data availability confirmed- [ ] Instructions providedEOF
# Send for publication review git send-email --to="editor@$journal.org" --cc="coauthors@university.edu" "$pub_dir"
echo "Publication patches sent" }
# Interactive academic workflow echo "Academic Collaboration Options:" echo "1. Setup research group" echo "2. Send research patches" echo "3. Send publication patches"
read -p "Select option (1-3): " option
case "$option" in 1) read -p "Research group email: " group_email setup_research_group "$group_email" ;; 2) read -p "Experiment name: " experiment read -p "Collaborators (comma-separated): " collaborators send_research_patches "$experiment" "$collaborators" ;; 3) read -p "Paper title: " title read -p "Journal: " journal send_publication_patches "$title" "$journal" ;; *) echo "Invalid option" ;; esac}
academic_collaborationDistributed Development Workflow:
Section titled “Distributed Development Workflow:”# Distributed development with email patchesdistributed_development() { echo "=== Distributed Development Workflow ==="
# Setup distributed workflow setup_distributed() { echo "Setting up distributed development"
# Configure for patch-based workflow git config sendemail.confirm always git config sendemail.thread yes git config sendemail.chainReplyTo yes
# Create patch management directory mkdir -p patches/archive mkdir -p patches/pending mkdir -p patches/applied
echo "Distributed development environment ready" }
# Create patch series create_patch_series() { local branch="$1" local description="$2"
echo "Creating patch series from $branch"
series_dir="patches/series-$(date +%Y%m%d-%H%M%S)" mkdir -p "$series_dir"
# Generate patch series git format-patch --cover-letter --numbered -o "$series_dir" --subject-prefix="PATCH" origin/main.."$branch"
# Add series description if [ -n "$description" ]; then echo "$description" >> "$series_dir/0000-cover-letter.patch" fi
# Create series metadata cat > "$series_dir/series.json" << EOF{ "branch": "$branch", "description": "$description", "created": "$(date)", "patches": $(ls "$series_dir"/*.patch | wc -l), "status": "pending"}EOF
echo "Patch series created: $series_dir" echo "Ready to send with: git send-email $series_dir" }
# Send patch series send_patch_series() { local series_dir="$1" local recipients="$2"
echo "Sending patch series: $series_dir"
if [ ! -d "$series_dir" ]; then echo "Series directory not found: $series_dir" return 1 fi
# Validate patches echo "Validating patches..." for patch in "$series_dir"/*.patch; do if ! git apply --check "$patch" >/dev/null 2>&1; then echo "ERROR: Invalid patch: $(basename "$patch")" return 1 fi done
# Send patches git send-email --thread --chain-reply-to --to="$recipients" "$series_dir"
# Archive sent series mv "$series_dir" patches/archive/
echo "Patch series sent and archived" }
# Apply received patches apply_patches() { local patch_dir="$1"
echo "Applying patches from: $patch_dir"
# Apply patches in order for patch in "$patch_dir"/*.patch; do if [[ "$patch" == *"cover-letter"* ]]; then continue fi
echo "Applying: $(basename "$patch")" if git apply "$patch"; then git add . git commit -m "$(grep '^Subject:' "$patch" | sed 's/Subject: \[PATCH[^]]*\] //')" else echo "Failed to apply: $(basename "$patch")" return 1 fi done
# Move to applied mv "$patch_dir" patches/applied/
echo "Patches applied successfully" }
# Interactive distributed workflow echo "Distributed Development Options:" echo "1. Setup distributed environment" echo "2. Create patch series" echo "3. Send patch series" echo "4. Apply received patches"
read -p "Select option (1-4): " option
case "$option" in 1) setup_distributed ;; 2) read -p "Branch: " branch read -p "Description: " description create_patch_series "$branch" "$description" ;; 3) read -p "Series directory: " series_dir read -p "Recipients: " recipients send_patch_series "$series_dir" "$recipients" ;; 4) read -p "Patch directory: " patch_dir apply_patches "$patch_dir" ;; *) echo "Invalid option" ;; esac}
distributed_developmentWhat’s the difference between git send-email and git format-patch?
Section titled “What’s the difference between git send-email and git format-patch?”git format-patch creates patch files, git send-email sends those patches via email. format-patch generates the patches, send-email delivers them.
How do I configure SMTP settings for send-email?
Section titled “How do I configure SMTP settings for send-email?”Set sendemail.smtpServer, sendemail.smtpPort, sendemail.smtpEncryption, sendemail.smtpUser, and sendemail.smtpPass in git config.
Can git send-email work without SMTP server?
Section titled “Can git send-email work without SMTP server?”No, send-email requires SMTP configuration to send emails. Use —dry-run to test patch formatting without sending.
How do I send patches to a mailing list?
Section titled “How do I send patches to a mailing list?”Configure sendemail.to with the mailing list address and use git send-email patches/ to send all patches in a directory.
What’s a cover letter and when should I use it?
Section titled “What’s a cover letter and when should I use it?”A cover letter is an introductory email for patch series. Use —cover-letter for multi-patch submissions to provide context and overview.
How do I handle email threading with send-email?
Section titled “How do I handle email threading with send-email?”Use —thread and —chain-reply-to options to create proper email threads where each patch replies to the previous message.
Can I send patches without git format-patch?
Section titled “Can I send patches without git format-patch?”Yes, use git send-email with revision ranges directly: git send-email —to=recipient@example.com origin/main..HEAD
How do I handle SMTP authentication?
Section titled “How do I handle SMTP authentication?”Configure sendemail.smtpUser and sendemail.smtpPass. For OAuth, use sendemail.smtpAuth and related OAuth settings.
What’s the —reroll-count option for?
Section titled “What’s the —reroll-count option for?”—reroll-count marks patches as updated versions (v2, v3, etc.) when sending revised patches after review feedback.
Can git send-email handle large patch series?
Section titled “Can git send-email handle large patch series?”Yes, but consider using —batch-size to send in smaller groups and —relogin-delay to avoid overwhelming SMTP servers.
How do I test send-email without actually sending?
Section titled “How do I test send-email without actually sending?”Use —dry-run to show what would be sent without actually sending emails.
Can I customize the subject prefix?
Section titled “Can I customize the subject prefix?”Yes, use —subject-prefix=“CUSTOM:” to set custom subject prefixes instead of the default “PATCH”.
How do I handle email encoding issues?
Section titled “How do I handle email encoding issues?”Configure sendemail.composeEncoding and i18n.commitEncoding to UTF-8, and use sendemail.assume8bitEncoding for special characters.
Can git send-email work with Gmail?
Section titled “Can git send-email work with Gmail?”Yes, configure with smtp.gmail.com:587, tls encryption, and your Gmail credentials (may need app passwords).
How do I send patches to multiple recipients?
Section titled “How do I send patches to multiple recipients?”Use —to for primary recipients, —cc for carbon copies, and —bcc for blind carbon copies.
What’s the —validate option for?
Section titled “What’s the —validate option for?”—validate checks patches for common issues before sending, helping catch problems early.
Can I reply to existing email threads?
Section titled “Can I reply to existing email threads?”Use —in-reply-to with the Message-ID of the email you’re replying to.
How do I handle patches with binary files?
Section titled “How do I handle patches with binary files?”git send-email works with text patches. Binary files in patches may cause issues - consider using git bundle for binary changes.
Can send-email work with corporate email systems?
Section titled “Can send-email work with corporate email systems?”Yes, configure with corporate SMTP settings. May need to work with IT for authentication and firewall rules.
How do I archive sent patches?
Section titled “How do I archive sent patches?”Keep patch directories organized by version/date, and consider creating a patches/archive directory structure.
Applications of the git send-email command
Section titled “Applications of the git send-email command”- Open Source Contributions: Submit patches to project mailing lists for review and integration
- Kernel Development: Participate in Linux kernel development workflows via email patches
- Distributed Teams: Enable collaboration across different locations and time zones
- Code Review Workflows: Facilitate formal patch review processes via email
- Corporate Development: Support enterprise development with email-based patch management
- Academic Research: Share research code changes through academic mailing lists
- Legacy Systems: Work with projects that don’t use modern pull request systems
- Backup Communication: Provide alternative contribution method when web interfaces fail
</final_file_content>
IMPORTANT: For any future changes to this file, use the final_file_content shown above as your reference. This content reflects the current state of the file, including any auto-formatting (e.g., if you used single quotes but the formatter converted them to double quotes). Always base your SEARCH/REPLACE operations on this final version to ensure accuracy.
<environment_details>
Visual Studio Code Visible Files
Section titled “Visual Studio Code Visible Files”src/content/docs/version-control/git/send-email.md
Visual Studio Code Open Tabs
Section titled “Visual Studio Code Open Tabs”src/content/docs/version-control/git/stash.md src/content/docs/version-control/git/submodule.md src/content/docs/version-control/git/switch.md src/content/docs/version-control/git/show.md src/content/docs/version-control/git/shortlog.md src/content/docs/version-control/git/show-branch.md src/content/docs/version-control/git/show-ref.md src/content/docs/version-control/git/show-index.md src/content/docs/version-control/git/sparse-checkout.md src/content/docs/version-control/git/send-email.md
Current Time
Section titled “Current Time”11/12/2025, 2:49:45 PM (Asia/Kuwait, UTC+3:00)
Context Window Usage
Section titled “Context Window Usage”229,544 / 256K tokens used (90%)
Current Mode
Section titled “Current Mode”ACT MODE