Reading Notes
Git Tutorial
What is ‘Version Control’?
Version Control is a system that allows you to revisit various versions of a file or set of files by recording changes. Through version control, one can revert a file or project to a previous version, track modifications and modifying individuals, and compare changes. By utilizing a Version Control System (VCS), mistakes with files can easily be rectified.
- Local Version Control: Basically refers to the one database on your hard disk that stores changes to files.
- Centralized Version Control: This system entails a single server storing all changes and file versions, which can be accessed by various clients.
- Distributed Version Control: Allows clients to create mirrored repositories. These data backups can be easily be placed on the server to replace any lost information. It also allows for multiple mirrored repositories, programmers working in teams can collaborate with each other in various ways to complete a joint project, which enables the use of various simultaneous workflows.
What is Git?
Git is a DVCS that stores data in a file system made up of snapshots. Each time you save a changed version of your project — called commit — Git creates a snapshot of the file and stores a reference to it. If the file has not changed, Git only stores a reference to the already-stored identical version of it.
Files in Git can reside in three main states:
- Committed: Data is securely stored in a local database.
- Modified: File has been chaned but not committed to the database.
- Staged: Flagged a file’s changed version to be committed in the next snapshot.