For example, differences in main.cpp file comparison work area and temporary area.
$ git diff main.cpp diff --git a/main.cpp b/main.cpp index 57a5778..24604db 100644 --- a/main.cpp +++ b/main.cpp @@ -1,6 +1,7 @@ #include <iostream> using namespace std; int main(){ - cout<<"Hello, World!"<<flush; + int a, b; + cout<<"Hello, World!"<<endl; return 0; } \ No newline at end of file
As described above, the source file is a temporary storage area, the target file is a work area;
(1) --- represents the source file, +++ represents the target file;
(2) @@ @@ -1,6 +1,7 summary difference indicates the presence of a first line in the source file and destination file of the first six rows of seven rows starting start;
(3) -: code source file on behalf of, on behalf of the + code for the target file; From the result, the work area codes increases the line "int a, b" (not yet temporary);