Create a readme.txt file with the contents of "hello world!", And index it
git add readme.txt I change the contents of the file to "hello git!", I run the git status command
git status -s AM readme.txt The git diff --cached and git diff --staged produce the same result.
diff --git a/readme.txt b/readme.txt new file mode 100644 index 0000000..a042389 --- /dev/null +++ b/readme.txt @@ -0,0 +1 @@ +hello git! What is the difference between these two parameters? If there is a difference, how to create a situation when it manifests itself?