Intro to Git


Scope

This page serves as a brief introduction to Git and offers a high-level comparison to another popular version control system, Subversion (SVN).

What is Git

Git is commonly referred to as a distributed version control system (DVCS). It's a tool many organizations use to collaboratively manage their projects and keep track of file changes.

Large software projects often involve multiple people working on the same set of files, making changes, deleting content, and moving code around. Git makes it easy by applying version control so developers can keep track of the files that were changed, who changed them, and creates a development history of the project as it grows in size and complexity.

This not only makes it easy to collaborate with colleagues on a project, but can be instrumental in speeding up development, identifying key issues to target, and discovering bugs before release.

Compared to Subversion (SVN)

Git is quickly becoming the standard for version control industry-wide and a major reason for this is due to the flexibility it offers. SVN is another popular version control system, but unlike Git, it relies on tedious consistency across all instances of the project. Because SVN is centralized in nature, all developers working with SVN must constantly commit to the centralized server to store any changes to a project.

Git is distributed in nature, which means there is no centralized repository. Each developer has their own instance of a project and can commit changes locally as they please. Due to the disconnect from a centralized server, operations such as commits, merges, diffs, and branches are much faster and it reduces the risk of a single point of failure.

gitvssvn

Using Git

Git is primarily a command line-based tool and so most users interact with Git via the command prompt on Windows or the terminal on Linux/Mac.

Typing in the word git followed by the command you want to call will initiate that command (e.g.: git status, git pull, git commit). You can also type in --help after git or any sub-command to bring up the help page for that command (i.e.: git --help, git status --help). Other articles within the KB dive deeper into these commands.

RStudio also offers some general features built in to interact with the Git ecosystem, and these features are also outlined in the KB.

Additional Resources

While this guide is an attempt to cover most of the basics behind Git, here are some additional resources you can consult for more in-depth information.

About Git
Try Git
Getting Git Right