You are currently in PREVIEW mode

Buy this book or become a member for full access.

Git Fundamentals

Chapter 1
An Introduction to Git


Git is a popular, free Version Control System, designed for use by software developers. The essence of Version Control is the ability to capture the state of software documents, and in doing so make it possible to revert to a previous state if required. The safety net that this provides aids collaboration, and encourages freedom to experiment.

So, if you're not a software developer, why would you care about Git? Can you recall a time when, working on something important, you found yourself wishing you could undo something? With Version Control you can, in effect, rewind time. By capturing snapshots of your progress, any stage in a project can be revisited and modified quite freely. You even have the ability to cherry pick certain changed files and merge them with others from different points along your project's timeline.

One of the things that makes Git special is that it's local—in other words, based on your own computer. As such, you don't need any special servers or complex equipment to use it. Since Git is file-based, it works with anything you can create or manipulate on a computer—text documents, image files, audio or video—and you can easily share or transport your work to other computers, even as an email attachment. When collaborating, Git enables all members of a team to work independently, and easily blend together the best of each contributor's efforts into a final product.

Traditionally, working on a project with multiple people can quickly become a nightmare of "change management." You make changes, then your colleague does likewise, and while another colleague is updating the document you suddenly remember some important facts that need to be added. So as not to forget, you make changes to your copy, but now there are multiple versions of the document, all with different amendments and no easy way to consolidate them.

Software developers face precisely this dilemma all the time—not to mention designers, content writers, video artists, web developers, and so on. And the system(s) that are used to help with this are called Source Code Management (SCM) systems. An SCM system helps to resolve conflicts among files and conflicts within a file as a result of multiple people making changes to the same file. Git is one of the most popular SCM systems, and it's available to anyone, at no cost.

If you're a photographer or digital artist, you can save your work at any state and freely experiment. If you're a programmer, you can save a program before you make big changes to improve performance. For someone who generates documents (a teacher who creates curricula, for example) the ability to effectively rewind time is immensely valuable. Similarly, if you've ever had a very large document that represents hundreds of hours of work and the computer suddenly can't read the file, a system like Git provides integrated backup, without the tedium of making multiple copies under different names.

Regardless of the type of development or design work you do—front-end UI development or back-end coding—managing the change and evolution of your working projects is both important and challenging. With Git, you'll be able to see all your changes, and even compare the differences between versions. Projects that use a Git repository can be stored on a site like Github or, because Git is file-based, you can even host it in a Dropbox folder.

Have your say! or become a member now to take part in the discussion