What is Git

Learn to code, learn web development basics, start a career in tech.

What is Git

Last edited: Aug 1 2019

What is Git: Beginners Guide

Git is an open source distributed version control system, it makes it possible for your local code to become a complete version control repository, where changes made can be tracked, reverted or removed.

Let me break it down and explain the definition

Control System: This basically means that Git acts as a system for controlling a piece of a given content, in this case, the content could a code base for a particular project passed over to git to control.

Version Control System: Every time we make a change to our code base, git allows us to commit this change and makes it possible to view the history of changes as well as make it easy to revert back to a previous version.

Distributed Version Control System: Every change we commit can be pushed up to remote server ( Github ) this can act as a backup away from our local computer, this also makes it possible for collaboration with other programmers on the same project.

Why is version control needed?

A complete change history by every individual that has ever worked on a project, these include created files, edited and deleted files, this makes it easy to track bugs in code.

Branching and merging, this means that different members can work on the same project in parallel by branhching off and then merging their work together at the end.

Finally using version control is a form of backup, with regular commits and pushes to the cloud, you can easily open any computer and pull down all your work.

Git Basics

Let me show you some basics of git

Git Commits

Every time you finish a stage of your work, you create something called a commit, this is essentially a snapshot of all your files at that point in history.

Now git will store this snap shot in a hidden folder called .git and at any time you can view a list of commit histories and revert back to a point of yor choice.

Git Branches

Branching in git makes it possible for parallel work, this means that you can work on two different features each having a branch of its own.

A branch could be for adding payment gateway to your app, whilst you are working on that another developer might be working on another branch for accepting discount coupons

This makes it possible to work on the same project with a team whilst not stepping on each others toes, thanks to git branches.