In the last Blog Git Basic WorkFlow we have moved changes from our working directory, to our staging index, and to the repository. And I have gave those changes simple labels A and B.
Actually Git usses different concept to track these changes or say snapshots of changes.
In a typical Git workflow, A would represent changes to 2 files or 3 filse and B would represent one new files that were added to the repository.
So How Git Track
When we submit changes to the repository, at that point Git generates a checksum for each changed set. A checksum is a number that is generated by taking data and feeding it into an
algorithm, checksum algorithm converts data into a simple number
The same data put into the algorithm always equals the same checksum coming
out that's important because if we change the data going in we get a different checksum out.
So one of the most common uses for checksums in computers is to make sure
that the data didn't change, if the data changed well then the checksum will be different.
And this data integrity is fundamentally built into Git that's very different
Git generates this checksum is by using the SHA-1 hash algorithm.
The number that the algorithm generates is always going to be a 40 character hexadecimal string (0 -9 and a - f)
Date: Mon Dec 14 13:44:18 2015 +0530
my initial commit
The commit ID is the SHA-1 number that will be unique to the changes that are in this commit. Git attaches the a bit meta information to each one of those snapshots, SO that git can trace the information.