ආයුබෝවන් ! (Ayubowan!) First things first!
![]() |
GitLab Intro Session at DevFest LK 2019 |
In a time of Corona Pandemic, first things first, but safety always comes first. Daily routines of the entire world is held at bay at the moment due to prevailing situation. but fortunately, thanks to the modern technology , most people have found new ways to engage in their daily works, staying at home by following remote work procedures. Here I am going to discuss about buzz words Version control, Git tools that are encouraging & helpful in working collaboratively and remotely in projects related to programming, graphic designs etc.
What is 'Version Control' and why should you care?
If you're a programmer, graphic designer or web designer; when you are designing projects, you would've often come across questions mentioned below.
- How do we keep track of different versions of our code?
- How do we collaborate with other people?
- How do we make sure that, we have an easy way out to revert back to an older version of our code once we make a change that forces our current state of the code to not working?
All these questions falls under the large umbrella, what is called as 'Version Control'.
So what actually version control does is that, it lets you track your files overtime. When you mess up while doing your project you can simply get back to a previous working version of your project file.
There are number of different version control software like Git, CVS, Apache Subversion, Mercurial, Monotone, Team Foundation Server etc. Among them Git is the most popular and used version control software.
So first let's try to understand how Git works.
![]() |
Popular Version Control Software |
Let's assume that we don't know about version control system. So under normal circumstances what would you do while designing your project? You would save a copy of your working file at each successful stage before moving in to the next step of your project. We are used to make backup copies of different versions of our project. Basically, that's what git also does. It tracks your saved state of the project.
The 3 Areas of Git
Imagine a scenario at a grocery items packing station (like Jehan's place Purchasing Lanka International - Koombiyo fans know it :) of a buying and selling company. It can be divided into 3 areas as follows.
![]() |
Procedural Areas of a packing station |
Similarly, Git can be divided into 3 areas.
![]() |
3 areas of Git |
1. The Working Directory
The working directory is the area where you are currently working. The items here are not tracked by git. Newly added and modified items are put here.
2. The Staging Area
The Staging area is where git starts tracking your files. Here you can select which files should be committed.
We can select the files using command:
git add filename
git add is like taking new items and putting them into a box.
3. The Local Repository
The Local repository is the database with the history about all changes to your project.
We can add changes/files to the repository using command:
git commit
git commit is like taping the box shut, labeling it with a message and putting it into a storage with other boxes.
![]() |
Normal version Control flow of Git |
The Staging area is also called Index.
The commit, on which your changes are based on (usually the latest commit) is called HEAD.
After commit, the Index will become the child of the HEAD. Then it will become the new HEAD
Git Repository:
A Git repository is the
.git/
folder inside a project. This repository tracks all changes made to files in your project, building a history over time. Meaning, if you delete the .git/
folder, then you delete your project’s history.
So, this is how the basic workflow of Git goes as seen as from the surface. But in deep inside a magical process is going on. I hope to dive deep in to Git in an upcoming blog post.
Get, Set & Ready to go with Git!
Get, Set & Ready to go with Git!
Stay Safe! Commit to Heal the World!
References:
https://git-scm.com/
https://en.wikipedia.org/wiki/Version_control/
https://betterexplained.com/articles/a-visual-guide-to-version-control/
https://www.cs50.harvard.edu/web/#git
Image courteasy- CSS(Computer.Science.Student@IG)
References:
https://git-scm.com/
https://en.wikipedia.org/wiki/Version_control/
https://betterexplained.com/articles/a-visual-guide-to-version-control/
https://www.cs50.harvard.edu/web/#git
Image courteasy- CSS(Computer.Science.Student@IG)
Awesome! 👏️
ReplyDeleteThank you!
DeleteGreat article!
ReplyDeleteThank you!
DeleteGood article. Keep up the good work!
ReplyDeleteThank you!
DeleteGreat content !
ReplyDeleteGreat article!
ReplyDelete