Could somebody explain how git knows internally that files X, Y and Z have changed? What is the process behind the scenes that recognizes when a file has not yet been added or h
I found the following explanation helpful in a recent course, Git Essential Training by Kevin Skoglund, I followed at Lynda.com.
Git generates a hash key composed of 40 hexadecimal characters by running an algorithm on the changes we have committed. For instance if we commit same set of changes at different occasions, we should get the same hash key.
Additionally it keeps track of previous changes by keeping following meta information in each commit.
Each subsequent commit will refer to a parent commit, while the first commit will not have a parent(or a null/nil value). The following diagram would be helpful in this regard.
Image credit : Git Essential Training by Kevin Skoglund at Lynda.com
Git Essential Training by Kevin Skoglund at Lynda.com