What is the benefits of using Git?

Hey guys,

Recently downloaded a tutorial from Lynda.com (Bootstrap 3) which the developer talks a little bit about Git.

From researching the internet I have found that it is a source code management (reference http://en.wikipedia.org/wiki/Git_(software))

But I’m confused as to why you would submit your code to Git unless you wanted other developers to work on the same project with you.

Can you please clarify if this is something that should be used when building new websites or is it something to release publicly that others can use once you have finished…

You can use Git on your own computer without uploading it to Git.com. I wrote a tutorial on doing this. Git is free to download and try.

Git allows you to create “branches” to test code with. When they are working properly, you merge the branch into the working site. You can have as many branches as you wish.

Git allows you to save all the versions of your site, day by day. You can revert to an earlier version quickly. You can read a summary of the last several versions to see what you (or a collaborator) did lately. You’ll add special “commit” messages to summarize what those files contain. Git has many ways of navigating those versions.

Git allows you to compare changed files among versions.

These are only a very few things you can do with Git. Some design firms will not hire anyone who has no version-control software (like Git) experience.

Hi Steven,

Thank you for your explanation.

Makes more sense now.

I will download some tuturials and start trying to get my head around it.

Cheers

Let’s say you’re building a website, and you want to add two new features to your site. A forum and a chat room. You’re working on both, and then a critical bug comes through that you need to fix. What do you do with the forum and chat room code you were working on?

If you’re using Git, you’d have a branching model, and any new tasks would be in their own branches. Also, the live branch would be separate from your main development branches. You’d have separate branches for the live site to fix critical bugs (with their own branches, of course), a forum branch and a chat branch.

This, for me, is the biggest benefit of source control. Keeping your source code safe is obvious, but this has been around for years with SVN and numerous other source control tools. Only since distributed version control tools have become mainstream has branching been considered a first-class citizen, and absolutely necessary to building a website.