What is Git?
Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. Git is easy to learn and has a tiny footprint with lightning fast performance.
Working:
The three main sections of a Git project are: The Working tree, the Staging area, and the Git directory. The basic Git workflow goes something like this:
1. You modify files in your working tree. These files are pulled out of the compressed database in the Git directory and placed on disk for you to use or modify.
2. You selectively stage just those changes you want to be part of your next commit, which adds only those changes to the staging area.
3. You do a commit, which takes the files as they are in the staging area and stores that snapshot permanently to your Git directory.
Git saves the state of your project as a picture of what your files look like and stores a reference to that snapshot. It thinks about its data more like a stream of snapshots. This makes it more like a mini filesystem with some incredibly powerful tools built on top of it.
Since the entire history of the project is right there on your local disk, most operations need only local files and resources to operate and seem almost instantaneous. For example, to browse the history of the project, Git doesn’t need to go out to the server, it simply reads it directly from your local database. Thus, you can work even if you are offline.
Everything in Git is checksummed before it is stored and is then referred to by that checksum. It uses a 40-character string composed of hexadecimal characters which is calculated based on the contents of a file or directory structure in Git. This functionality is built into Git at the lowest levels and is integral to its philosophy. You can’t lose information in transit or get file corruption without Git being able to detect it.
Article: @shubh27shah
Credits :- Vineet Mankani , Vaishnavi Arolkar