Quick reference for Git commands and concepts while reading Pro Git.
Git was developed in 2005 by Linus Torvalds as an alternative to the proprietary BitKeeper version control system.
The major difference between Git and other VCS is how Git “thinks” about its data. Instead of storing information as a set of files and the changes made to each file over time (delta-based version control), Git thinks of its data like a stream of snapshots of a miniature filesystem.
If files have not changed, Git doesn’t store the file again, just a link to the previous identical file.
Most operations in Git need only local files. Also, everything in Git is checksummed before it is stored and then referred to by that checksum (an SHA-1 hash). This means we can’t use information in transit or get file corrupt without it getting detected.
Commands
git diff --staged
- Show diff for staged files