MrJobs (4) [Avatar] Offline
#1
We deleted two files a & b by using the rm command and got the output below. What does the output tell us ? How do we interpret it ?

diff --git a/a b/a
deleted file mode 100644
index e69de29..0000000
diff --git a/b b/b
deleted file mode 100644
index e69de29..0000000
rickumali (130) [Avatar] Offline
#2
This git diff format is called 'the patch format', and it's described here:

https://git-scm.com/docs/diff-format/2.0.0#_generating_patches_with_p

In the case of deleting files, git diff will emit its usual headers, and in the index row (the index is the old name for the "staging area") it announces that the file pointed to by SHA1 ID e69de29 was turned into '0000000', which is Git's way of saying "non-existent".

(This '0000000' is used in the case of creating new files, but viewing the 0s is trickier: skip ahead to section 15.1.3 (listing 15.6) to see a brief discussion.)

My book shows how to use git show on any Git SHA1 ID in Section 15.3.2, but I don't cover the case of deleting files. If you type git show e69de29, you'll see your file's contents.