Skip to main content

Git : To do and Not To do: Part- 1

Git is a version control system that helps to maintain versions of your work over time.

The above line may seem a bit overwhelming to read at first, as there are words which most of us not really understand as of now. Just read along and I will help you in getting some idea of why git is a resource every developer has to be sound with and why it is a integral part of every developer's everyday life.

A version control system :-

We all have heard the saying that Rome was not built in a day and believe me, if it is not your college assignments , no great app was ever built in a day or at least without using a VCS( version control system).

Every app has multiple sections. Every section require some skills that is used to develop it. A skill may come under a set of skill that a contributor has.  When we work alone or in a group with other developers, making any single project, it tends to happen that people take up sections that they are good at, as they believe that they can contribute most in it. In this way a tree is formed. The workflow don't really then remain linear but gets diverged. Now lets see a example

Imagine a situation in which there are five people in a group and developing and not using anything like a VCS . Do you see that in this case  there is a serious issue of a starting point or a base? Okay, assumed that one of them took the responsibility of writing the initial lines, but what next? How can other person get his work and then continue to write the app? Do you see a serial workflow? Until one person write and mails/ messages/ telepathy/ any other super power his code to other, he can't really start working ahead. Also, since multiple copies of the same app is present with everyone , there are chances that a person messes up is local assets and do not then realise where to look for the files or if deleted, have to wait over again to get the newest set of copies. Such a approach can't really be thought of even. That will just make your development experience boring and very very unprofessional , and you might know that building something itself may get very intimidating at times, such a approach will only be a last choice or not even that.

So, i guess you now are convinced that we require something that makes the flow better and keeps the enthusiasm. A VCS comes into the picture.

Version control systems are a category of software tools that help a software team manage changes to source code over time. Version control software keeps track of every modification to the code in a special kind of database. If a mistake is made, developers can turn back the clock and compare earlier versions of the code to help fix the mistake while minimizing disruption to all team members.

For almost all software projects, the source code is like the crown jewels - a precious asset whose value must be protected. For most software teams, the source code is a repository of the invaluable knowledge and understanding about the problem domain that the developers have collected and refined through careful effort. Version control protects source code from both catastrophe and the casual degradation of human error and unintended consequences.
Software developers working in teams are continually writing new source code and changing existing source code. The code for a project, app or software component is typically organized in a folder structure or "file tree". One developer on the team may be working on a new feature while another developer fixes an unrelated bug by changing code, each developer may make their changes in several parts of the file tree.
Version control helps teams solve these kinds of problems, tracking every individual change by each contributor and helping prevent concurrent work from conflicting. Changes made in one part of the software can be incompatible with those made by another developer working at the same time. This problem should be discovered and solved in an orderly manner without blocking the work of the rest of the team. Further, in all software development, any change can introduce new bugs on its own and new software can't be trusted until it's tested. So testing and development proceed together until a new version is ready.
Good version control software supports a developer's preferred workflow without imposing one particular way of working. Ideally it also works on any platform, rather than dictate what operating system or tool chain developers must use. Great version control systems facilitate a smooth and continuous flow of changes to the code rather than the frustrating and clumsy mechanism of file locking - giving the green light to one developer at the expense of blocking the progress of others. Read the full article about VCS here .

Since you now know what a VCS really means, why don't we see what git is.

The official git website defines git as-:

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
Git is easy to learn and has a tiny footprint with lightning fast performance. It outclasses SCM(Source Control Management) tools like Subversion, CVS, Perforce, and ClearCase with features like cheap local branching, convenient staging areas, and multiple workflows.
I guess that was a bit intimidating, a more general definition is here :-
Git is a mature, actively maintained open source project originally developed in 2005 by Linus Torvalds, the famous creator of the Linux operating system kernel. A staggering number of software projects rely on Git for version control, including commercial projects as well as open source. Developers who have worked with Git are well represented in the pool of available software development talent and it works well on a wide range of operating systems and IDEs (Integrated Development Environments).By far, the most widely used modern version control system in the world today is Git.
Having a distributed architecture, Git is an example of a DVCS (hence Distributed Version Control System). Rather than have only one single place for the full version history of the software as is common in once-popular version control systems like CVS or Subversion (also known as SVN), in Git, every developer's working copy of the code is also a repository that can contain the full history of all changes.
In addition to being distributed, Git has been designed with performance, security and flexibility in mind.   read the full article here

The Important Difference:-

Github and git are very well known terms that you also might have heard of. Many tend to think both of them as same or nearly same. It is important to understand that the only thing common between Git and github is the substring 'git' . Else these both are completely different software implementations.

Github is a webapp that hosts your git controlled projects or as they are called, repositories. There are many other apps like github(what? Really!). Check out sites like bitbucket and gitlab. These all  apps that helps you to host your VCS based projects so that any developer in your team that is practically not in your vicinity can still work with you alongside being in your vicinity. And git is what you learnt earlier.   For more information, check this SO link
I guess this article is getting really big and I afraid many would not read it just because this being a TL;DR . I will be writing more on how you can learn git in another article and also give you resources and GUI's for the same. Till that time, keep contributing!
Thank you!

Comments

Popular posts from this blog

Git : Todo and not Todo : Part-2

Hello there! This is the second part to introduction to git. If you have not read the first part then please first go through that first, as proceeding along here without that introductory knowledge will not be really helpful.Here is a link TL;DR All the git commands that we will be talking about, now and later-: git init git clone git add git commit git status git remote git push git pull git fetch git branch git reset So, lately we learnt about Version Control Systems also abbreviated as VCS and got to know about git and how it is completely different from github and other VCS hosting websites. In this part we will be looking on the more practical part of using this wonderful tool and also why we should learn it very first in our development career. Later, I will also help you understand that git is just a small part of the entire development career that you aspire to make and why it should not be considered just more than a medium to share your code with...

Competitive Programming

Competitive programming is a mind sport usually held over the Internet or a local network, involving participants trying to program according to provided specifications. Contestants are referred to as sport programmers. Competitive Programming mainly focuses on our ability to find efficient solutions to well-defined problems. Usually, a question arises - Why Competitive Programming? Many of the top tech companies like Google, Facebook hire people through a test which includes competitive programming. Also, participation in the ACM International Collegiate Programming Contest (ACM-ICPC) is a great opportunity to be seen by Apple, Facebook, Google, IBM and many other authorities in the IT sphere. These major companies are constantly keeping track of the participants to find talented employees. Having experience in competitive programming shows employers you can work in a team, solve complicated problems, work in stressful situations, manage time and deadl...

A beginners guide to NumPy

The previous post took you through the basics of machine learning using python with scikit-learn and tensorflow, this post will give you a brief introduction to Numpy. NumPy is a python package which stands for "Numeric Python". It enables you to do mathematical computations easily and effectively hence making coding simpler. http://www.numpy.org/ Installing via pip: After having python3 and pip installed, installing packages can be done using the following command on windows cmd. >>> python - m pip install -- user numpy scipy matplotlib ipython jupyter pandas --user   makes pip install packages in your home directory instead, which doesn't require any special privileges. Import Numpy: >>> import numpy as np Now we use np as a reference to numpy in the code. Numpy arrays: Create a numpy array of type np.ndarray: >>> A = np.array([[1,2,3],[4,5,6],[7,8,9]]) Create a numpy array containing ones/...