Let us check what is Git and GitHub and how they work. To understand this, let us imagine a scenario where we are writing a document or a piece of software or app or just an essay or poem. When we start to write or develop we create the file(s) and then write stuff into it, after some time we get some ideas or points so we write again and this we want to save with different name or version so that we know the difference between first and the current one. It will be easy for us to refer what was written in first sitting. So, we name the file/folder like underscore (_)1,2 etc. or datetime or any other mechanism to be able to differentiate and remember easily. Basically, we want the history of all the changes made to the file and this where Git comes to our rescue. Instead of we struggling to arrange separate files and keep track of all the changes, Git a software that does automatically for us which takes snapshot of file changes and keeps track of all changes. Git is a type of distributed version control system that records all the changes made to the repository by one or many people.
Git is not a just version control but a collaborative platform where more on person can work on the project or same document at the same time. So, this is a system that we can use track all the changes to project and as well allow large number people from different parts of the world collaborate and work on the project. Git was created in the year 2005 by Linus Torvalds for the development of Linux Kernel, to version control the Linux project.
Difference between a central repository and distributed is that in tools like SVN the changes are made directly to central repo whereas with Git the whole repo is copied/cloned to our machine as a local copy. We can make the changes on our local copy as many we can and commit it locally and when decide it is ready, we then push the changes to the central server. This feature of Git encourages people work continuously and share bits of code regularly than to have to connect to the server every time you make a change.
Git can be installed on our machines, laptops and use to record all the ongoing changes, we do not internet to access it. Compared to other similar version control systems and apart from that it is free, Git has a very good branching mechanism. Git branching allows us to create an independent branch of the code, where we can write code, ideas and collaborate with all the history being tracked. To use Git, we can download the software and install and after that if we want to create a new repository, from command line go to the folder of our project and just type “git init”. Now if we go to the folder and check that the “. git” hidden folder is created; this is the place it stores all the details.
Coming to GitHub, it is Git repository hosting service, it is a webserver or service on top of Git, it is a collaboration website that interacts with Git, or it is can also defined as it is a cloud-based hosting service that helps us manage Git repositories. Let us not scratch our head too much to know the differences or similarity between the tool which are similarly named. In simple words, Git is a version control system that lets you manage and keep track of your source code history, while Git is command lie tool and GitHub takes it further by providing web based friendly UI to manage Repos, cloud based platform for collaboration, strong access controls and security features, it has other features like task management, issue tracker and recently pipelines i.e. GitHub actions and other feature sets.
It comes in different variants starting with GitHub Free version for developers and teams, then we have Team which is paid option which includes all the feature options like code owners, more build minutes, more package storage. And the third is Enterprise with advanced options and features that helps for corporates.
GitHub Enterprise can be used in two different options cloud-hosted like SaaS offering “GitHub Enterprise Cloud” and self-hosted that is on-premise “GitHub Enterprise Server”
We discussed about what is Git and GitHub and how they are related, how Git is different and best then other version control tools and also discussed on GitHub purchase options. In next blog will cover GitHub feature details.