diff: add -Naur create patch file example (#6484)

beep
Mehrad Mahmoudian 2021-09-20 13:09:41 +03:00 committed by GitHub
parent 9040e5a171
commit 96100f42d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 5 deletions

View File

@ -9,20 +9,24 @@
- Compare files, ignoring white spaces:
`diff -w {{old_file}} {{new_file}}`
`diff --ignore-all-space {{old_file}} {{new_file}}`
- Compare files, showing the differences side by side:
`diff -y {{old_file}} {{new_file}}`
`diff --side-by-side {{old_file}} {{new_file}}`
- Compare files, showing the differences in unified format (as used by `git diff`):
`diff -u {{old_file}} {{new_file}}`
`diff --unified {{old_file}} {{new_file}}`
- Compare directories recursively (shows names for differing files/directories as well as changes made to files):
`diff -r {{old_directory}} {{new_directory}}`
`diff --recursive {{old_directory}} {{new_directory}}`
- Compare directories, only showing the names of files that differ:
`diff -rq {{old_directory}} {{new_directory}}`
`diff --recursive --brief {{old_directory}} {{new_directory}}`
- Create a patch file for Git from the differences of two text files, treating nonexistent files as empty:
`diff --text --unified --new-file {{old_file}} {{new_file}} > {{diff.patch}}`