kids encyclopedia robot

Git facts for kids

Kids Encyclopedia Facts
Quick facts for kids
Git
Git-logo-2012.svg
Git-logo-white.svgShow dark mode logo
Git-logo-2012.svgShow light mode logo
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.53.0  Edit this on Wikidata / 2 February 2026
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, especially when many people are working on the same project. Think of it like a super-smart notebook that remembers every change you make to your work. It's mostly used by programmers to manage the source code (the instructions that make a computer program work) when they build software together.

Git was designed to be very fast, keep your data safe, and allow many people to work on different parts of a project at the same time, even on different computers. It's like having many separate paths (called 'branches') for different ideas, all connected to the main project.

One cool thing about Git is that everyone working on a project gets their own complete copy of the project's history. This copy is called a 'repository' or 'repo'. This means you can work on your project even without an internet connection! Git also helps everyone share their changes and keep their copies updated. Often, teams use a main online server to keep an official, combined copy of the project.

Git is a free and open-source program. This means anyone can use it, change it, and share it.

Linus Torvalds, who also created the Linux kernel (a very important part of many computer operating systems), first made Git. The name 'Git' is a registered trademark of the Software Freedom Conservancy.

Today, Git is super popular! Almost all software developers use it to manage their projects. Many online services like GitHub, SourceForge, Bitbucket, and GitLab help people store and share their Git projects.

How Git Was Created

Git was created by Linus Torvalds in April 2005. Before Git, the Linux kernel project used a different system called BitKeeper. When the free license for BitKeeper was taken away, Linus needed a new tool. He wanted something that worked even better than what they had before.

Linus looked at other free systems, but none were fast enough or safe enough for the huge Linux project. He needed a system that could handle many changes quickly. He set a goal: applying changes should take no more than three seconds! He also had other important ideas for Git:

  • It should be the opposite of older, less efficient systems like CVS.
  • It needed to work well for teams spread out in different places.
  • It had to be super secure against mistakes or bad changes.

Because no existing tool met his high standards, Linus decided to build his own. He started writing Git right away.

Development of Git began on April 3, 2005. Just a few days later, Linus announced the project. It quickly became powerful enough to manage the Linux kernel itself. By June 16, 2005, Git was already used for the official kernel 2.6.12 release!

Linus handed over the main work of maintaining Git to Junio Hamano on July 26, 2005. Junio then led the project to its first official version, 1.0, on December 21, 2005.

What's in a Name?

Linus Torvalds joked about the name git (which is British English slang for an unpleasant or silly person). He said, "[...] I name all my projects after myself. First 'Linux', now 'git'."

The instructions that came with the program explain the name further:

"git" can mean anything, depending on your mood.

  • A random three-letter word that's easy to say and not used by other computer commands.
  • Stupid, contemptible, despicable, or simple. You can pick from a dictionary of slang.
  • "Global information tracker": when you're happy, and it works perfectly.

[...]

The code for Git also calls the program "the information manager from hell."

How Git Works

Git was designed based on Linus Torvalds's experience with the huge Linux project. He knew a lot about how computer filesystems work. This helped him create a system that was very efficient and reliable.

Instead of just tracking changes to single files, Git takes 'snapshots' of your entire project at different times. Imagine taking a picture of your whole folder every time you save your work. This makes it very good at seeing how the whole project changes.

Git helps combine changes from different people working on the same project. It has smart ways to put everyone's work together smoothly.

Storing Your Project's History

Git operations
How Git stores information and changes in a project.

Git uses a clever way to store all your project's information. It has two main parts:

  • An index (also called a 'stage' or 'cache'): This is like a temporary holding area. It keeps track of the changes you've made and are ready to save next.
  • An object database: This is where all the actual pieces of your project's history are stored. Once something is saved here, it doesn't change.

The index acts as a link between your current work and the saved history.

Git stores different kinds of information:

  • File contents: These are the actual words and data in your files.
  • Folder structures: These show how your files are organized in folders.
  • Commit records: These link all the snapshots together to form a history. Each record includes who made the change, when, and a message explaining what they did.
  • Tags: These are like special labels you can add to important points in your project's history, such as a major release.

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

Git stores each new version of a file completely at first. To save space, it later combines these into 'packs'. These packs only store the differences between files, making them much smaller.

Git also uses labels called 'refs' (short for references) to point to important moments in your project's history:

  • Branches: These are like different paths of development. When you make a change, the branch automatically moves forward to your new save point.
  • HEAD: This special label always points to the very latest save point you are working on.
  • Tags: These are fixed labels that point to a specific save point, often used for marking releases.

Basic Git Commands

Git uses simple commands to help you manage your projects. Here are some common ones:

  • `git init`: Use this to start a new Git project in a folder on your computer.
  • `git clone [URL]`: This command copies an existing Git project from an online location to your computer.
  • `git add [file]`: This adds a file to your 'staging area', meaning you're preparing it to be saved.
  • `git commit -m [commit message]`: This command officially 'saves' your changes to the project's history. You also add a short message explaining what you changed.

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

Where Git Runs

GNOME gitg
gitg is a graphical tool that helps you use Git.

Git, the main program written in C, works on many different computer systems. It runs on Linux, macOS, and Windows, as well as other systems like BSD and Solaris.

There are also other versions of Git written in different programming languages, like Java, Go, Python, and Rust. This means Git can be used in many different kinds of software and tools.

Git Servers and Online Sharing

Gitweb
A screenshot of gitweb, which lets you view Git projects on the internet.

Because Git is designed for sharing, you can use it to set up your own server to host projects. Git comes with a simple tool called `git daemon` for this.

Many dedicated Git servers also exist. These often add features like controlling who can access your project, showing your project's contents on a website, and managing many projects at once.

Free and Open-Source Server Options

There are many free and open-source tools you can use to host your own Git projects:

  • Gerrit: This server helps with code reviews and access control.
  • Phabricator: A tool that also supports Git, originally from Facebook.
  • RhodeCode: Supports Git, Mercurial, and Subversion.
  • Kallithea: Another option that supports both Git and Mercurial.
  • Gogs, Gitea, and Forgejo: These are popular choices for self-hosting, all developed using the Go language.

Online Git Services

Many companies offer Git project hosting as a service. These are very popular for teams and individuals to store and share their work online. The most well-known services include GitHub, SourceForge, Bitbucket, and GitLab.

Easy-to-Use Graphical Tools

Git also comes with a graphical user interface (GUI) that makes it easier to use. This GUI lets you do things like saving changes, creating new branches, and working with online projects using visual buttons and menus instead of typing commands.

Many other companies have also created their own graphical tools for Git. These tools help you see your project's history, branches, and changes in a visual way. They make Git simpler to learn and use, helping people work more efficiently and make fewer mistakes.

How Popular is Git?

Git is incredibly popular among software developers!

  • In 2014, the Eclipse Foundation reported that Git was the most used tool for managing source code.
  • Surveys from Stack Overflow in 2015, 2017, 2018, and 2022 showed that Git was the top choice for developers. In 2022, nearly 94% of developers said they used Git as their main tool.

This table shows how popular Git is compared to other version control systems:

Name 2015 2017 2018 2022
Git 69.3% 69.2% 87.2% 93.9%
Subversion 36.9% 9.1% 16.1% 5.2%
TFVC 12.2% 7.3% 10.9%
Mercurial 7.9% 1.9% 3.6% 1.1%
CVS 4.2%
Perforce 3.3%
VSS 0.6%
IBM DevOps Code ClearCase 0.4%
Zip file backups 2.0% 7.9%
Raw network sharing 1.7% 7.9%
Other 5.8% 3.0%
None 9.3% 4.8% 4.8% 4.3%

Git Extensions

Many extra tools, called 'extensions', can be added to Git to give it more features. For example, Git LFS (Large File Storage) helps manage very big files in Git projects. These extensions are often created by different people but can become very popular and widely used.

Other open-source Git extensions include:

  • git-annex: A system for syncing files based on Git.
  • git-flow: A set of tools that help manage different branches in a project.
  • git-machete: A tool for organizing your project and automating common tasks.

Microsoft also created an extension called VFS for Git to help handle the huge amount of code in the Windows operating system. This extension lets you download only the parts of the project you need, saving space and time.

Common Ways to Use Git

People use Git in many different ways, but some common practices have developed:

  • When you start a new Git project, it usually creates a main branch called master or main. This branch is often where all the finished changes are brought together.
  • If you make a mistake and save it, you usually don't erase it. Instead, you make a new save that undoes the mistake. This keeps the history clear for everyone.
  • Workflows like 'git-flow' help teams organize their branches. They might have branches for new features (like `feature/*`), for testing (like `develop`), and for the final product (like `main`).
  • A 'pull request' (or 'merge request') is when someone asks to add their changes from one branch into another. Git itself doesn't have this feature built-in, but it's a very common and useful part of online Git services like GitHub. It helps teams review changes before they become part of the main project.

Keeping Git Safe

Git is designed to work with other tools that help control who can access your projects. It has features to protect your project's history from accidental damage.

Over the years, like many complex software programs, Git has had updates to fix security issues. For example, in 2014 and 2015, updates were released to make sure that malicious files or links couldn't cause problems for users. Git also uses special codes (called SHA-1 hashes) to make sure that the project's history is accurate and hasn't been tampered with. These codes are regularly updated to stay strong against new threats.

The Git Trademark

The word "Git" is a registered trademark of the Software Freedom Conservancy. It was officially registered in the United States on February 3, 2015.

See also

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

  • Comparison of source-code-hosting facilities
  • Comparison of version-control software
  • List of version-control software
kids search engine
Git Facts for Kids. Kiddle Encyclopedia.