Git: A cheat sheet


Git is an easy to use open source tool for team collaboration, though developers primarily use it to manage source code. Get details about this Linus Torvalds-created version control system.

Git is the most widely-used, modern version control system (VCS) in the world. This tool enables users and developers to collaborate on local machines/networks or via public servers. Developers should think of Git as their go-to collaboration tool.

Also, Git works seamlessly with GitHub (the world’s leading code hosting platform), though it doesn’t require the use of a public-facing service; in fact, Git can be easily used on a single machine or via a Git server on your own private network. Either way, collaboration on code or every kind of file is made exponentially easier.

This Git smart person’s guide is a quick way to get up to speed on the VCS. We’ll update this resource periodically when there is new information about Git.

SEE: All of TechRepublic’s smart person’s guides

Executive summary

  • What is Git? Git is a VCS that enables individuals or teams to collaborate and work with the same files. Git isn’t just for programmers–users can check out files, modify them, and check them back in. Any document can be collaborated on in this VCS. Git can be used from within a text-based terminal window or one of the many GUI Git clients. Git is also a handy way to install applications from source on Linux.
  • Why does Git matter? There are only a few other tools that make collaboration as easy. Git has become the de facto standard for developers around the world. With this tool, collaborators can avoid the confusion that often accompanies users editing the same files. Git makes all of this seamless and easy.
  • Who does Git affect? Git affects collaborators of all kinds, as well as anyone looking to install applications on Linux.
  • When was Git released? Git was developed by Linus Torvalds and was initially released on April 7, 2005. The current stable release, 2.14.2, was released September 22, 2017.
  • How do I install and use Git? Git can be installed from the standard Linux repositories or on Windows/macOS using their respective installers.

SEE: Job description: DevOps engineer (Tech Pro Research)

What is Git?

Git is a version control system that enables users to track changes in files and collaborate on those files with numerous people. Git was written by Linus Torvalds to help maintain the development of the Linux kernel; it was inspired by BitKeeper and Monotone. The initial release was April 7, 2005, and Git has been in steady development ever since. Although Git is primarily used by developers for the management of computer source code, it can be used to track changes with any file type. Git also allows Linux users to easily pull down source code from hosting websites, so it can be installed on a local machine.

SEE: The truth about MooCs and bootcamps: Their biggest benefit isn’t creating more coders (TechRepublic)

Git is what is known as a distributed revision control system (DRCS) and uses snapshots as opposed to differences, which are used in standard VCS systems. Instead of storing its data as a list of file-based changes, Git stores data as a set of snapshots within a miniature file system. As soon as a commit is made to a file within Git, it takes a snapshot and stores a reference to the snapshot–this makes the system more lightweight and the process of merging files and code much easier.

Every Git directory on every computer is a complete repository with a full history and version tracking ability that is independent of network access or a centralized server; this means a single machine can be used as a complete Git repository. Git works seamlessly with GitHub to create an efficient means of global collaboration within user repositories.

From a Git repository, a user can pull down a file, commit changes to the file, push the file back to the repository, and even merge two more file histories together. Git can be used from within a terminal window or from within one of the many GUI tools; some of the popular GUIs are GitKraken, SmartGit, Git Extensions, Sourcetree, Tower, Git Cola, GitUp, TortoiseGit, and GitHub Desktop.

Additional resources

Why does Git matter?

When Larry McVoy withdrew free usage of the BitKeeper product, many of the Linux kernel developers gave up using the tool. Because of this, Linus Torvalds (the creator of the Linux kernel) decided he needed a distributed system that would meet his demand for higher performance. Out of this was born the open source Git, one of the most efficient version control systems available.

SEE: Linus Torvalds on Linux, life, and bathrobes (ZDNet)

A VCS is essential for the development process. With such a system, you can return to any version of your code (or file) with ease, rendering it unnecessary to constantly save under different file names to ensure you can return to a previous state. With Git, a developer can easily give collaborators access to their code without worrying those developers might overwrite their work.

Without Git, open source developers around the globe would have a much harder time collaborating. Git redefined how developers work together. When you add the seamless integration with GitHub, Git becomes a must-have for collaborators.

Additional resources

Who does Git affect?

Developers–from individuals to staff at small companies or enterprises–work with Git. According to Google Trends, Git is currently demolishing the competition when it comes to Google searches. When you look at the companies that use Git–which include Google, Facebook, Apple, Microsoft, NVIDIA, Quara, Twitter, eBay, Intel, and GE Aviation–you get an idea of the system’s dominance.

Git is especially popular within the realm of open source. Without Git, the development of the Linux kernel wouldn’t progress as quickly or efficiently.

All of this, in turn, affects consumers, as they are the recipient of vastly improved development cycles.

Additional resources

When was Git released?

Linus Torvalds began developing the Git project on or around April 3, 2005 and made the first announcement of the project on April 6, 2005. Git became self-hosting as of April 7, 2005. Ever since its initial release, Git has seen steady development. The current version is 2.14, but versions all the way back to 2.4 (released April 30, 2015) are still supported.

Additional resources

What are the main competitors to Git?

Git does have competitors, though not many of them are nearly as popular.

How can I install and use Git?

Git can be installed on any Linux distribution from the standard repositories. For example, with Ubuntu, the installation of Git can be handled via a single command:

sudo apt install git

On the macOS and Windows platforms, you must download and install using the dedicated installation files (macOS, Windows).

Once installed, create your first repository and start adding files. A local Git repository can be connected to a GitHub repository for public collaboration.

Additional resources


Image: Git

Source link


Please enter your comment!
Please enter your name here