git

What is Git and version control?

What is version control?

Man, I wish I could save the current state of the project. That way I can just roll back if I screw up!

– Every programmer ever

Imagine doing a programming project. At some point you might introduce some extensive changes, and this thought pops into your head. Maybe you then proceed to copy the entire project folder as a backup. Congratulations! You are manually doing version control management. It’s not very robust. It’s hard to manage. It’s error prone. Nevertheless, you do have a version control system.

A version control system is all about making these kinds of scenarios easier to handle. It will keep track of changes to a file or a set of files over time. This way you can recall specific versions, or states, of your project later. For us, being software developers, the focus is files containing code or related to software projects. But really, it could be any kind of file on a computer.

Why do we need version control?

Software code can change a lot over time and is often created by a team of people working together and collaborating on the same set of files. This introduces a plethora of complexity.

  • Is the file I’m writing code in now already updated with the changes you did yesterday?
  • Or is it an older version?
  • And who did the last change on line 36 in the file hello_world.py?

These are all things a version control system can answer for you. 

In addition to being able to revert individual files or the entire project to an earlier state, it can compare changes over time. And, if you also add a hosting service like GitHub in the mix, you have remote backup and an easy way to share the code with your collaborators.

What is Git?

In the early 2000’s Linus Torvalds decided to create a new version control system that better suited his needs developing the Linux operating system. It needed to be fast, support big projects, be fully distributed and have a simple design. Git was born.

There are a number of different version control systems. You might have heard of Subversion or Mercurial. But the most popular, by far, used by millions of developers around the world, is Git.

Git can be used in various ways. There exists a number of graphical user interfaces. But the best way of learning it and understand what is really going on, is by using the command line tool. It is also easier to start using a GUI after having learnt the command line tool.

What is GitHub?

GitHub is a hosting platform for projects using Git. There are also other hosting platforms like Gitlab and Bitbucket, but GitHub is the most popular one. By using GitHub, your project will have a remote backup and can easily be shared between developers working together. In addition to the features already provided by Git, they have collaboration tools like access control, bug tracking, feature requests, task management and more.

It is safe to say that to fully utilize the power of Git in your project, you also need to make use of a remote hosting platform like GitHub.

Conclusion

Lets get our hands dirty. The next step now is to install Git and start using it.