A guide to Git for beginners
If you're just learning about software development, or are brand new to open source, it won't be long before you encounter Git, a source code management tool and arguably one of the most successful open source projects ever. We asked senior developer evangelist Brendan O'Leary to fill in the background on Git's history and successes in honor of its 15th anniversary.
What is source code management?
Before you start in software engineering, it's important to understand the concept of source code management. In its simplest form, software is a bunch of text files and if I'm using those by myself it's not a big deal. But when multiple people use multiple files it gets out of hand, and you need some way to manage it all. Humans can't necessarily manage all of that easily: If you're working with files A and C, and I'm working with C and D, you need a way to bring all the changes we've made together without overriding anything or causing any conflict. A computer can more easily figure that out, and in a nutshell, that's what source code management is.
Why the term Git?
There are several different urban legends about this. Linus Torvalds, who wrote it is a pretty gruff person with some acknowledged sharp edges. And so, the story suggests he actually named it after himself, as in the British slang word, “git”. That may be apocryphal. Also, it's a three-letter combo, meaning it's short and didn't conflict with any existing Unix commands. Now, people say it stands for “Global Information Tracker” or “GD Idiot Truckload of...” if you're mad at it.
But wait. Who is Linus Torvalds?
Linus Torvalds is a Finnish-American software engineer who developed the Linux kernel and then invented Git 15 years ago. Torvalds has been quoted as saying he's more "famous" for Linux but that over time, Git will end up being more important. Torvalds is also widely seen as the godfather of the open source movement.
Can you explain the rationale behind the cult following of open source?
Torvalds himself has a cult following, and open source has been around for a very long time, long before Git was invented. But open source wasn't widely accepted and, in some cases, companies were actively hostile to the concept. Torvalds wanted to create a project everyone could contribute to, and Git was born (literally developed by Torvalds over a weekend 15 years ago). Git solved a problem that was common across all types of software development, and it not only welcomed contributions from users, but it also needed contributions to grow. The idea of a practical solution everyone could contribute to created a kind of zeitgeist, and today open source is widely embraced as a result.
How could I explain Git to my neighbor?
We tend to discuss Git as a tree, but I really don't know if that is the best analogy for it. It's a tree in the sense that it makes branches, but then those branches come back together, and that doesn't happen in a tree.
Instead, I'd say Git is like a time machine. The whole history of everything that happened on any branch in alternate timelines is brought back together magically. Nothing is lost or changed, and you can look backward and move forward. It's magic.
What's the most important thing I should know about Git?
That's easy: You can't break it!
Because it's a magical time machine, you really can't do anything to it that can't be fixed. So, I always tell beginners to relax and play around with your copy. No matter how many mistakes you make, you can't break it in a way that's not fixable.
Have no fear.
This was originally published on the GitLab Blog