What is GIT?

GIT is a version control tool just like CVS, Preforce etc but it works totally in a different way, if you need to undestand GIT you have to understand it like a totally new concept, trying to map concept of this tool with any another similar tool will not help you any faster.

GIT stores the changes like a stream of snapshots. Note these snap shots will only contain the changes that you have made with the previous version and not the complete file it self. If there is no change then it does not create a file or store the snapshot of it, GIT just links the file to it previous version.

Advantages of GIT :
1. All the GIT operation is possible in local : In traditional version control you have to compare the file history then you have to hit the repository and compare it but in case of GIT it all happens locally, this prevents the GIT from network dependency latency and give it a overhead of fast comparison.
2. GIT has integrity : Everything in GIT is stored in form of checksum, so you cannot escape from GIT after making any changes, even after you pull the data from repository GIT does compare the checksum(SHA-1 algorithm) to see if there were no damage done while transferring the file over the internet.
3. GIT Generally only Adds data : All the changes you make in GIT are store in GIT in the form of additional data, and you can go back to any point of time you committed the data since GIT maintains all of it, and hence you can code without the fear if loosing the previous code.

Three stages of GIT :
1. Committed : The file changes are successfully committed to the repository.
2. Modified : The file has been changes but not committed to the repository.
3. Staged : The file has been changes and it is marked as stages i.e the changes will go in the next commit made to the repository

Note : Staging is a new middle layer where you mark the files that there are the files that has been modified and need to committed.

Leave a Comment