Created
April 10, 2019 10:05
-
-
Save infotroph/bafb1871a76cbcef20460fdbad3cca26 to your computer and use it in GitHub Desktop.
Why does touching a file mark it changed in diff-index but not status? And then why does status mark it unchanged for diff-index?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0> git init | |
Initialized empty Git repository in /Users/chrisb/git_test/.git/ | |
0> echo "some\ncontent" >> foo.txt | |
0> git add . | |
0> git commit -m 'first' | |
[master (root-commit) 3e1a325] first | |
1 file changed, 2 insertions(+) | |
create mode 100644 foo.txt | |
0> git diff-index HEAD | |
0> touch foo.txt | |
0> git diff-index HEAD | |
:100644 100644 6cfc2af7f5fbb8cd7cb226e7a70d1829a0678767 0000000000000000000000000000000000000000 M foo.txt | |
0> git status | |
On branch master | |
nothing to commit, working tree clean | |
0> git diff-index HEAD | |
0> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment