Quality Holidays at Affordable Prices

Are you fed up of the greys and hustle-bustle of your life? Do you need to explore the world and beyond? If yes, then you have come to the right place as Citrus Holidays has designed some incredible…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




What is Git?

It is the most famous version control system used widely in the world, So what is a version control system? Version control means the process of tracking and managing software code for changes made by different programmers. Version control system is a software system that does this process. It was developed by Linus Torvalds in 2005 as he found out that no other version control system at the time met his need so he set out to build his own !! Its initial release was on 7 April 2005.

So this question might arise what is the purpose of git or why to use a version control system

Centralized version control system

A centralized version control system follows a client-server architecture model in which there is a central server to which the users working on a project can access the current version of the code their working on and share the changes or updates. The problem with this type of system is that the users depend on a single server and the failure of the server will cut access to the users for collaboration purposes snapshots of the codebase cannot be saved and the users have to wait until the server comes online thus causing a delay in workflow and many other issues.

Centralized VCS

Distributed version control system

The distributed version control system follows a peer-to-peer architecture model in which every user working on the project has a snapshot of the codebase including the history of changes and updates and any subsequent changes done will reflect in their local machine and can be synchronized with other users even if the central server goes offline. Git and mercurial are famous distributed version control system.

Since Git is the most famous version control system out there it is best to learn git and its subsequent cloud-based hosting platform where you can manage the repositories in a centralized cloud server which is called GitHub. Through GitHub we can access our repository from anywhere as it is stored remotely .Git and GitHub are closely related in terms of name and functionality, it has a lot of difference like Git is developed by Linus Torvalds and is opensource where as GitHub proprietary and is owned by Microsoft.

Distributed VCS

Repositories: These are the central location for all the files of the project that is up for collaboration or version control it can be either local or remote. The git repository also contains details of the history of changes made and each version of the codebase after any modification which can be accessed using git. The repository contains a “.git” folder which is a hidden folder automatically created by git after initializing the folder as a git repository. This hidden folder contains all the metadata about the history of changes and versions made inside the codebase by individual users or collaborators.

Commit: These can be understood as when changes are made and updated to the codebase the details about the any changes made have to be specified like the reason for the modification of code ,deletion of a file etc. This process to create a snapshot of the code base after modification and changes is referred to as commit. So next time when we refer to the history of changes that occurred in the codebase we call it commit history. With the help of commits, we can revert to the previous version of the specified commit which means to access the snapshot of the codebase at that particular commit .

Branch: It can be defined as a copy of the main working project codebase which serves as a separate line of development independent of the main codebase which is in the branch called ‘master’. These branches act as a pointer for the snapshot of the changes made in the current branch you are working on. Once the modification or experimental features if suitable to be used in the main codebase is accepted then they can be merged with the master branch after a certain set of procedures because mostly this process can get complicated.

git branch

Push: The term push refers to the act of uploading local commits of a repository to a remote repository or it can be referred to as a tool that transfers local commits to a remote repository.

Pull: It is the opposite of push it refers to the act of downloading commits and contents from a remote repository and updating it to the local repository.

Merging: It is the process of combining changes made from one branch to another desired branch. This process is not quite simple as it seems because this can get complicated mostly if there are changes in both branches and combining them can cause conflict issues that need to be solved before merging.

Clone: It is the creation of a copy or clone of the current project and saving it in a new folder/directory at some other location. The original repository from which the clone has been made might exist in the local machine or a remote location.

Fork: Fork means to create an independent copy of the repository completely disconnecting from the original repository This means that when we fork a remote repository, a copy of the repository is created on the Git hosting service like GitHub and we can clone the forked repo from our account. The basic difference between clone and fork is that fork is done on a remote server which creates an independent copy and can be modified independently whereas clone creates a linked copy that will continue to synchronize with the original repo.

Working Tree: A working tree refers to files and directories in the local repository where we make changes before committing them to the staging area(index). Here we can try out different things in our files and only specify the changes that we wish to see in the commit history by specifying them in the staging area.

Staging Area: It typically means the buffer zone that acts between the working tree and the repository which is where Git starts tracking the changes that occurs and commits those changes that we specify.

Thus I hope that I tried my best in explaining to you what is git .This is just the beginning more to come :)

Add a comment

Related posts:

The Power of Social Media Marketing

Social media has become an essential tool for bloggers to grow their audience and reach new readers. With billions of active users across various platforms, social media provides bloggers an…

Give yourself the gift to relax

People around me keep running from place to place. They carry their phones in their hands and check them endlessly. Everyone keeps running, looking at their screens for a new e-mail to arrive, for a…

Breve

Me cansam pessoas que ja foram demasiadamente próximas e hoje cospem pílulas de protesto sem o mínimo de embasamento Não se precisa de embasamento para saber onde falta, mas o mínimo e necessário…