1. Modify the file
Convert the file contents:
This is first sentence. This is second sentence.
change into:
This is my first sentence. This is my second sentence.
2. Check the current status
$ git status
Prompt the content:
On branch master Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) modified: readme.txt no changes added to commit (use "git add" and/or "git commit -a")
The prompt content tells us that the file has been modified, but the specific modification content cannot be seen.
3. View the specific modification content
$ git diff readme.txt
Prompt the content:
diff --git a/readme.txt b/readme.txt index 78762af..6991a86 100644 --- a/readme.txt +++ b/readme.txt @@ -1,2 +1,2 @@ -This is first sentence. -This is second sentence. \ No newline at end of file +This is my first sentence. +This is my second sentence. \ No newline at end of file
Fourth, add to the warehouse again
$ git add readme.txt
5. Submit to the warehouse again
$ git commit -m "update readme.txt"
Prompt the content:
[master aba1751] update readme.txt 1 file changed, 2 insertions(+), 2 deletions(-)
The submission is successful!