Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
September 15, 2020 07:11 am GMT

8 Reasons Why Git is so Popular

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, youd have to wait for 5 seconds. Pretty annoying, right? With version control its quite the same were 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 youre on the move? With a centralized VCS like Subversion or CVS, youre stranded if youre not connected to the central repository. With Git, almost everything is possible simply on your local machine: make a commit, browse your projects 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 theres 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 isnt 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 cant 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, ). Its 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 dont 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. Dont Mix Things Up

diagrams-illustrations.002

Separation of concerns is paramount to keeping track of things. While youre working on feature A, nothing (and no-one) else should be affected by your unfinished code. What if it turns out the feature isnt 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.


Original Link: https://dev.to/gittower/8-reasons-why-git-is-so-popular-3mj4

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To