git diff takes two inputs & computes the difference between them.
Inputs can be commits, files (files from repo or never added before)
diff shows differences between two files/snapshots
patch does the same but shows more information that can be used more widely
explains how to alter file/codebase
patch is asymmetric: patch one way is not the same as the other way
Example
create a file with text
hello
testing
this is a test file
modify the text & save to a NEW file
in vim, can be done with :w (NEW FILENAME)
hello
temporary file
this is a new file
this is a new line...
run git diff -–no-index file.txt new_file.txt
output can show various pieces of info
diff --git a/text.txt b/2text.txt
index 542a987..a1d4e77 100644
--- a/text.txt
+++ b/2text.txt
@@ -1,3 +1,5 @@
hello
-testing
-this is a test file
+temporary file
+this is a new file
+this is a new line...
+