mirror of
https://github.com/mike-rambil/Advanced-Git.git
synced 2026-02-07 09:19:19 -06:00
18 lines
588 B
Markdown
18 lines
588 B
Markdown
[⬅️ Back to Sharing Changes as Patch Files](./sharing-changes-as-patch-files.md)
|
|
|
|
[⬆️ Previous Step: Apply Diff File](./apply-diff-file.md)
|
|
|
|
# Patch vs Diff: Quick Reference
|
|
|
|
|
|

|
|
| Command | Use Case | Preserves Commit Info? | Can Apply With |
|
|
|---|---|---|---|
|
|
| git diff > file.diff | Share uncommitted changes | ❌ | git apply |
|
|
| git format-patch > file.patch | Share committed changes | ✅ | git am |
|
|
|
|
|
|
---
|
|
|
|
_Author: mike-rambil • Updated: 2024-06-10 • Tags: patch, diff, reference_
|