mirror of
https://github.com/mike-rambil/Advanced-Git.git
synced 2025-12-19 16:39:52 -06:00
1.1 KiB
1.1 KiB
⬅️ Back to Sharing Changes as Patch Files
⬆️ Previous Step: Apply Patch with Commit Metadata
Create Patch from Uncommitted Changes
Command
git diff > changes.diff
Examples
- Create a diff file of uncommitted changes.
git diff > changes.diff
- Create a diff file for the last commit.
git diff HEAD~1 > last-commit.diff
Steps
- Run '
git diff > changes.diff' to save uncommitted changes to a file.
Warnings
- ⚠️ This does NOT preserve commit metadata or history—just raw changes.
Links
➡️ See the Next Step: Apply Diff File
Author: mike-rambil • Updated: 2024-06-10 • Tags: diff, uncommitted, snapshot