When working with code on a project it is very important that you keep an active record of changes to the
project. This is especially important if the code will be worked on by more than one team member. This is where
a version control system is very useful. A version control system acts as an active record of all of your
changes and allows you to work on new features and improvements, all while staying up to date with the changes
every team member makes to the overall code.
Version control software gives you the ability to backup and restore work easily. At anytime, you can revert to a
previous revision, which is especially important when you run into a bug that manages render previously-working
bits of code defunct. With version control, you can go back and check what changes were made, so
you can compare the files and see where in your code you are going wrong. If that fails, another cool thing
is just the ability to hop back to a revision before you started working on that code and just start fresh with
a working version. One of the biggest benefits of version control is the ability to have a sandbox environment,
which means having an isolated area where you can test out and fix all of the kinks in your project before you
push the code out live.
Controlling with git?
One of the most poplar version control tools is called Git. Git is pretty old and requires you to use the
terminal or command line, which might have scared some people away in the past, but today there are sites such
as GitHub which act as a visual representation of all the things happening
Before you get started working with Git, I think it is important to understand a few common key terms.
Repository. This is where all of your files will live. Sites like GitHub house all of your
files on a server, or you can even just create a local folder and make that your repository. It is also common
for people to shorten this term to “repo.”
Commit. This is how you are able to set up a viewable timeline with your files. When you commit,
you are saving a place where you just added a change and are able to leave a comment so others can see what you
have changed. You are able to jump through these commits to see your code base at different times.
Branch. A branch allows you to work on features simultaneously. Common practice is to have a
master branch in which you keep your latest working copy of the project and then branch out from there to
develop new features. When you finish the coding a feature, simply merge the branch you are working on with the
master branch and prune the old branch. I have included an image below if this is a little confusing.
This should give you a good starting point at getting familiar with version control software. Next time I will go
over how to set up a repo and some common commands you can use to get started!