Intermediate LevelGit & GitHub
How do git format-patch and git am share commits via email patch files?
❓ Interview Prompt: Explain git format-patch, RFC-822 formatted email patch files, and applying patch sets using git am.
git format-patch exports commits as RFC-822 formatted email patch files (.patch), and git am applies patch files sequentially into repository history, preserving original authorship.
Code Implementation Example
bash
git format-patch -2 HEAD
git am 0001-feat-add-auth.patch💡Exporting and applying email patch files using git format-patch and git am.
🎯 Interview Key Takeaway
Use git format-patch to export commits as email patch files, and git am to apply them into commit history.
#git format-patch#git am#Patches#Intermediate
Back to all Git & GitHub Questions→