kids encyclopedia robot

Git facts for kids

Kids Encyclopedia Facts
Quick facts for kids
Git
Git-logo-2012.svg
Git session.svg
A command-line session showing repository creation, addition of a file, and remote synchronization
Original author(s) Linus Torvalds
Developer(s) Junio Hamano and others
Initial release 7 April 2005; 20 years ago (2005-04-07)
Stable release
2.50.1 Edit this on Wikidata / 8 July 2025
Preview release
Lua error in Module:Wd at line 1575: attempt to index field 'wikibase' (a nil value).
Written in Primarily in C, with GUI and programming scripts written in Shell script, Perl, Tcl and Python
Operating system POSIX (Linux, macOS, Solaris, AIX), Windows
Available in English
Type Version control
License GPL-2.0-only

Git is a special computer program that helps people keep track of changes to files. Think of it like a super-smart history book for your computer projects. It's often used by programmers to manage the source code (the instructions that make a program work) when they are building software together.

One of Git's main goals is to be super fast. It also makes sure your data stays safe and supports teamwork where many people work on different parts of a project at the same time.

Unlike some older systems, Git gives every person working on a project their own full copy of the project's history. This means you can work on your part even without an internet connection. Each copy is called a "repository" or "repo." Git helps these different copies stay in sync, so everyone has the latest changes. Even though everyone has a copy, teams often use a central server to keep one main, updated version.

Git is also free and open-source software. This means anyone can use it, share it, and even help make it better.

Linus Torvalds, who also created the Linux kernel (the core of the Linux operating system), first made Git. Today, Git is the most popular way for developers to manage their code. Almost all professional developers use it. Many online services like GitHub and GitLab offer places to store Git projects.

How Git Helps with Project History

Git is designed to help teams work together smoothly. It lets many people make changes to the same project without messing things up.

Keeping Track of Changes

Git keeps a detailed record of every change made to your files. This is super helpful because you can always go back to an older version if you make a mistake. It's like having an "undo" button for your entire project.

Working Together on Projects

When a team works on a project, each person can create their own "branch." This is like making a separate copy of the project to work on new features or fix problems. Once their work is ready, they can "merge" their branch back into the main project. Git helps combine these changes without conflicts.

Fast and Secure

Git is known for being very fast, even with huge projects. It also uses special codes to make sure that the history of your project is safe and hasn't been changed by accident or on purpose.

The Story Behind Git

Linus Torvalds started creating Git in April 2005. Before that, the Linux kernel team used a different system called BitKeeper. When BitKeeper's free license was taken away, Linus needed a new tool.

He wanted a system that was:

  • Super fast: Applying changes should take only a few seconds.
  • Different from older, less efficient systems.
  • Good for teamwork, like BitKeeper was.
  • Very strong at protecting against corrupted data.

Because no existing free system met his needs, Linus decided to build his own. He started on April 3, 2005, and Git was already being used for the Linux kernel development just a few days later.

Why the Name "Git"?

Linus Torvalds jokingly named his project "Git." In British English, "git" can mean a silly or unpleasant person. He said, "I'm an egotistical bastard, and I name all my projects after myself. First 'Linux', now 'git'."

The official description of Git also says it's "the stupid content tracker." But don't worry, it's actually very smart! The name is just a bit of a joke.

How Git Works Internally

Git is like a smart filing system for your project. It doesn't just save files; it saves snapshots of your entire project at different times.

Git operations
Some data flows and storage levels in the Git revision control system

Storing Your Project's Data

Git uses two main parts to store information:

  • An index (also called the "staging area"): This is like a temporary workspace where you prepare your changes before saving them permanently.
  • An object database: This is where Git stores all the actual pieces of your project's history.

Inside the object database, Git stores different types of "objects":

  • A blob is the content of a file.
  • A tree object is like a folder, holding a list of files and other folders.
  • A commit object links these tree objects together, creating the history. It includes who made the change, when, and a message about what was done.
  • A tag object is like a sticky note that marks important points in your project's history, like a specific release version.

Each piece of data in Git gets a unique ID based on its content. This helps Git keep everything organized and makes sure nothing gets accidentally changed.

Saving Space with Packs

When you first save changes, Git stores each new piece separately. To save space, Git later combines many of these pieces into "packs." These packs are compressed, making them much smaller. This helps keep your project history from taking up too much room on your computer.

Basic Git Commands You Can Use

Git is often used through a command-line interface, which means you type commands into a text window. Here are some common ones:

  • git init: This command creates a new Git project in your current folder.
  • git clone [URL]: This command makes a copy of an existing Git project from the internet onto your computer.
  • git add [file]: This command tells Git to start tracking changes to a specific file. It adds the file to your "staging area."
  • git commit -m [commit message]: This command saves the changes you've added to the staging area into the project's history. You also add a short message explaining what you changed.

You can also create a file called .gitignore. Any files listed in this file will be ignored by Git. This is useful for things like passwords or very large files that you don't want to track.

Different Ways to Use Git

Git can be used on many different computer systems, including Linux, macOS, and Windows.

Git on Windows

The main version of Git was first built for Linux. To make it work on Windows, special tools were created to help Windows act a bit like Linux. Now, there are also versions of Git built directly for Windows, making it easier to install and use.

Other Git Programs

Because Git is so popular, many other programs have been created that use Git's ideas. For example, JGit is a version of Git written in the Java programming language, and Go-git is written in Go. These allow developers to use Git features within their own applications.

Git Servers and Online Services

Since Git is a "distributed" system, any Git project can act like a server. This means you can share your project directly with others.

Hosting Your Own Git Server

You can set up your own computer to host Git projects using a built-in command called git daemon. There are also many free and open-source programs like Gerrit and Gitea that help you manage Git projects on your own server, adding features like user accounts and web interfaces.

Online Git Services

Many companies offer services where you can host your Git projects online. These are very popular for teams and individuals. The most well-known ones include GitHub, SourceForge, Bitbucket, and GitLab. These services often add extra features like "pull requests" (where you ask someone to review and merge your changes) and tools for discussing code.

Visual Tools for Git

While you can use Git by typing commands, many people prefer to use graphical tools. These are called GUI clients.

GNOME gitg
gitg is a graphical front-end using GTK+.

These GUI tools make Git easier to use by showing you a visual picture of your project's history. You can see branches, commits, and file changes in a clear way. They also make it simpler to do common tasks like saving changes, creating new branches, and fixing conflicts when different people change the same part of a file.

Git even comes with its own basic GUI tool. Many other companies and developers have also created their own GUI tools that offer similar or even more features. Using a GUI can help you learn Git faster and work more efficiently.

How Popular is Git?

Git is incredibly popular among software developers. Surveys show that it's the most widely used tool for managing source code.

For example, in 2022, almost 95% of developers surveyed said Git was their main system for keeping track of code changes. This shows just how important Git has become in the world of software development.

Git Extensions

Sometimes, people create extra tools that work with Git to add new features. These are called "Git extensions."

One popular extension is Git LFS (Large File Storage), which helps Git handle very large files like videos or big images more easily. These extensions are often created by the community and can sometimes even become part of Git itself if they are widely used.

Microsoft also developed an extension called VFS for Git to help manage the huge amount of code for the Windows operating system. This extension helps by only downloading parts of the code when they are actually needed.

Common Ways to Use Git

While Git can be used in many ways, some common practices have developed over time:

  • Main Branch Names: When you start a new Git project, the main branch is often called "master." However, many tools like GitHub and GitLab now use "main" as the default name instead. This main branch is where all the different changes are usually combined.
  • Reverting Changes: If a mistake is made and saved, instead of completely deleting the bad change, developers usually add a new change that undoes the old one. This keeps the history clear.
  • Workflows: Teams often follow specific ways of working with Git, like "git-flow." This involves naming branches in a certain way to keep track of new features, ongoing development, and official releases.
  • Pull Requests: A "pull request" (or "merge request") is a common feature on online Git services. It's a way for a developer to ask others to review their changes before they are added to the main project. It's like saying, "Hey, I've finished this work, can you check it and then add it?"

Keeping Git Secure

Git itself doesn't directly control who can access your files. Instead, it works with other tools that handle access permissions.

Like any software, Git has had security updates. For example, in 2014 and 2015, updates were released to fix issues that could potentially allow someone to run harmful commands if they tricked a user into downloading a specially crafted project. Git developers quickly fixed these problems to keep users safe.

Git uses a special code called SHA-1 to identify each piece of data. While SHA-1 is generally strong, Git has been updated to use a more secure version of it to protect against advanced attacks.

Trademark Information

The name "Git" is a registered trademark of the Software Freedom Conservancy. This means they own the rights to the name.

More to Explore

  • Comparison of source-code-hosting facilities
  • Comparison of version-control software
  • List of version-control software

See also

Kids robot.svg In Spanish: Git para niños

kids search engine
Git Facts for Kids. Kiddle Encyclopedia.