Patch to File Converter
Upload or paste a .diff or .patch file to extract the final content of the files within it.
How to Use
Input Patch: Paste your patch content or upload a .diff/.patch file.
Select a File: The tool will list all files found in the patch. Select a file to preview its content.
Copy or Download: Copy the cleaned code for the selected file, or download it directly.
Input Patch
Files in Patch
No files detected yet.
Cleaned File Content
Select a file from the list to see its content.
About the Patch to File Converter
The Patch to File Converter is a utility that allows you to extract the final, clean content of one or more files from a single `.diff` or `.patch` file. It's especially useful for multi-file patches, where you want to see the changes for each file individually.
Common Use Cases
Reviewing Large Pull Requests
Isolate and view the changes for a single file from a large pull request that touches many files.
Extracting a Single File
Quickly get the final version of a specific file from a patch without needing to apply the patch locally.
Archiving and Documentation
Convert patch files into a set of clean, readable source files for documentation or archiving purposes.
Manual Patch Application
When a patch fails to apply automatically, this tool can help you extract the content for each file so you can apply the changes manually.
Example of a Multi-file Patch:
Pasting a patch with multiple files will populate the file list on the left.
Frequently Asked Questions
What's the difference between this and the Patch Cleaner tool?
The Patch Cleaner is designed for single-file patches or for getting a combined output from a multi-file patch. This tool, the Patch to File Converter, is specifically designed to handle multi-file patches by separating the content for each file, allowing you to view and download them individually.
What happens if a patch contains a new file?
The tool will correctly handle new files created in a patch. The cleaned output will be the full content of the new file.
What about binary files?
This tool is designed for text-based files. If a patch contains changes for a binary file (like an image), the tool will likely not be able to process it correctly and may show garbled text.
Is my code secure?
Yes. All processing is done in your browser. Your code is not sent to any server, ensuring your data remains private and secure. When you close the page, the data is gone.
How do I generate a multi-file patch?
You can generate a patch for a range of commits using git format-patch
. For example, git format-patch HEAD~3
will create patch files for the last three commits. To create a single patch file for multiple commits, you can use git diff
.