What is version control?
Version control is most useful for?
- Stores specific versions of a file that can be recalled later.
- Can be done with any type of file.
- Useful in web/app design.
What was used for version controlling in early days?
What was RCS and how did it work?
- Earlier people used to create time-stamped directories for version control.
- To solve this programmers developed simple database to track file history.
- Example: RCS worked by keeping patch sets in a special format, to recreate that file in a specific point in time.
What are centralized version control system?
What’s their downside?
- To allow collaboration between developer under different versions of files, Centralized Version Control Systems were made, eg: Subversion
- They suffer from single point of failure, as there is a single server on which everyone collaborates
What are Distributed VCS?
Example of VCSs?
- Solves the problem of centralized vcs.
- Full history of the file is stored on client computers and in case server dies, the full history of those files can be reuploaded.
- Git, Mercurial are example of distributed version control systems.
What did git improve over previous VCS?
Major difference between Git and other VCSs?
The way Git does file versioning helps in creating branches.
- Git’s goal was to be fast, lightweight, powerful and fully distributed
- Other VCSs store a file and incremental changes made to the file and versions.
- Git stores different versions of files as a snapshot and not incremental changes.
- This makes git like miniature filesystem.
What are the benefits of git?
How is integrity conserved in git?
Why is it safe to do experiments on file using git without having to worry reverting back to original version?
- Almost all operations in git is local:
- All of the snapshots of the file is stored locally and hence switching versions work on light speed as compared to Central VCS.
- Git can work offline and does not require internet. Commit now, Push later.
- Integrity:
- Everything in Git is checksummed before it is stored and referred through it.
- Checksum is done through SHA-1, which is generated by the file content or the directory structure in Git.
- Little changes or file corruption will change the hash generated and hence will be caught.
- Auto-Save:
- Generally all actions on Git add data to the database.
- This means most actions we do on Git are reversible.
Three states git files can be in?
- Modified/Working Directory: File changed but uncommitted to database.
- Staged/Index: File marked to go into commit snapshot.
- Committed/.git directory: File safely stored in database.
Commands to open manual page for a git action.
- git help
- git —help
- man git-
- Concise manual page: git -h