Basic Understanding Of Git and GitHub

Basic Understanding Of Git and GitHub

What is Git?

  • Git is a powerful and popular version control system that enables effective tracking of changes in source code.

  • It was developed by Linus Torvalds in 2005 for Linux kernel development.

  • It is used for keeping track of code changes and collaborating with others on code.

  • It uses a decentralized model where each developer has their own copy of the repository and works immediately on the project.

Why use Git?

  • Track changes to your code easily.

  • You can collaborate on code with others easily.

  • Git repositories can be stored on remote servers, such as GitHub, GitLab, etc.

  • You can create branches and merge changes in them.

  • If you make a mistake, you can easily revert to a previous version of your code.

What is GitHub?

GitHub is a web-based platform that provides hosting for version control using git. It is a subsidiary of Microsoft, and it offers all of the distributed version control and source code management (SCM) functionality of Git as well as adding its own features. GitHub allows you to store your repo on their platform. It also comes with GitHub ability to collaborate with other developers from any location.

What is version control? How many types of version controls we have?

Version control is a system that tracks changes to a file or set of files over time so that you can recall specific versions later. It allows you to revert files back to a previous state, revert the entire project back to a previous state, compare changes over time, see who last modified something that might be causing a problem, who introduced an issue and when it happened, and many more.

There are two types of version control:

  1. CVCS (Centralized Version Control): It uses a central server to store all the versions of a project's files. Developers "check out" files from the central server, make changes, and then "check in" the updated files. It is possible for others to see your changes by updating. Examples of CVCS include Subversion and Perforce.

  2. DVCS (Distributed Version Control): It contains multiple repositories. Each user has their own repository and working copy. Just committing your changes will not give others access to your changes. This is because commit will reflect those changes in your local repository, and you need to push them in order to make them visible in the central repository. Similarly, when you update, you do not get other changes unless you have first pulled those changes into your repository.