loading...
Cover image for 8 Reasons Why Git is so Popular
Tower

8 Reasons Why Git is so Popular

gntr profile image Tobias Günther Originally published at git-tower.com ・4 min read

When it comes to version control, everybody is talking about Git these days. But because it has become a standard, it's often adapted blindly - without knowing why exactly Git is superior to other systems like Subversion, Mercurial, or CVS. Even if you're already using Git, I think it's good to understand what makes Git great.

Read on for some hard (and soft) facts about why Git has become so popular.


1. Save Time

Imagine that, every time before moving your mouse, you’d have to wait for 5 seconds. Pretty annoying, right? With version control it’s quite the same – we’re also only talking about a few seconds per command, but it quickly adds up in your work day. Git, however, is lightning fast. Use your time for something more useful than waiting for your version control system to get back to you.

git_performance


2. Work Offline

What if you want to work while you’re on the move? With a centralized VCS like Subversion or CVS, you’re stranded if you’re not connected to the central repository. With Git, almost everything is possible simply on your local machine: make a commit, browse your project’s complete history, merge or create branches… Git lets you decide where and when you want to work.


3. Undo Mistakes

diagrams-illustrations.004

Sometimes I make mistakes (it was a shocking discovery for me, too!). What I love about Git is that there’s a little “undo” command for almost every situation. Correct your last commit because you forgot to include that small change. Revert a whole commit because that feature isn’t necessary, anymore. And when the going gets tough you can even restore “deleted” commits with the Reflog – because, behind the scenes, Git rarely really deletes anything. This is peace of mind.

If you want to learn how to undo your mistakes with Git, take a look at the free First Aid Kit for Git, a series of short videos that teach you how to save your neck using Git.


4. Sleep Easy

Have you ever smashed a Subversion repository? I have (and I say this with the associated headache still in vivid memory…). With Git, I can be totally confident because every clone that someone on the team has on their machine is a usable backup. Additionally, almost every action in Git only adds data (deleting is very rare). That makes it pretty hard to really screw things up. And this is a good feeling.


5. Make Useful Commits

diagrams-illustrations.003

There are (at least) two problems when throwing milk, ice cream, and a tomato into a blender. First, after switching it on, no one can tell what you actually put in from looking at this mess. And second, you can’t “roll back” the tomato. The same holds true if you commit a bunch of unrelated changes (a little bit of feature A, something from feature B, a nice little bugfix, …). It’s hard for your teammates to understand what happened and they cannot easily roll back feature A if it causes problems. Git helps you to avoid this mess and create granular commits. With its unique “staging area” concept you can determine exactly which changes shall be included in your next commits, even down to single lines. This is where version control starts to be useful.


6. Work in Your Own Way

When working with Git you can use your very own workflow. One that feels good for you. You don’t have to be a code acrobat to qualify for using Git. Of course, you can connect with multiple remote repositories, rebase instead of merge, and work with submodules when you need it. But you can just as easily work with one central remote repository like in Subversion. All the other advantages remain – regardless of your workflow.


7. Don’t Mix Things Up

diagrams-illustrations.002

Separation of concerns is paramount to keeping track of things. While you’re working on feature A, nothing (and no-one) else should be affected by your unfinished code. What if it turns out the feature isn’t necessary anymore? Or if, after 10 commits, you notice that you took the completely wrong approach? Branching is the answer for these problems. And while other version control systems also know branches, Git is the only one to make it work as it should: fast & easy.


8. Go With the Flow

Only dead fish swim with the stream. And sometimes, clever developers do, too. Git is used by more and more well-known companies and Open Source projects: Ruby On Rails, jQuery, Perl, Debian, the Linux Kernel and many more. A large community often is an advantage by itself because an ecosystem evolves around the system. From code hosting platforms like GitHub and GitLab, to GUI tools like Tower all the way to tutorials and documentation: everything you need is already there!


Take Your Git Skills to the Next Level

Git can add tremendous value to your development workflow. But only if you go beyond the basic "commit, pull, push"!

There are lots of free tutorials on Git available - you only have to invest a bit of your time to become a better developer.

Posted on by:

gntr profile

Tobias Günther

@gntr

Tobias is the CEO of Tower, the popular Git desktop client that helps more than 100,000 developers around the world.

Tower

The team behind Tower - a better way to work with Git.

Discussion

markdown guide
 
  1. Sleep Easy Have you ever smashed a Subversion repository?

In the 16 years I have used (and administered) subversion. This has never ever happened to me. (I have fubar'ed up my local git clone once though, and even have lost a bunch of hours of work.)

 
 

Many more version control systems are actually free and open source.

 

What I love about git is how hackable it is. There's lots of things that you shouldn't normally do but sometimes become necessary and git lets you do all those things.

 

Aside from point 1 it seems that you are mostly comparing Git to Subversion. How about, say, Mercurial? I haven't used it in years, but I think it could easily fulfill points 2-8 too.

 

Good point, Pawel! Mercurial is indeed one of the other great, modern alternatives. But still there are quite some differences: e.g. in how things like the Staging Area, Stash, and Branching model work in detail.

And maybe most importantly: the ecosystem. All the tools and services around Git give it a considerable advantage, even outside of its actual implementation.

 

I think the only reason I liked git was being able to investigate and compare changes to lines instead of whole files. The only problem is crlf, windows users have little issue with it.