The contents of this tutorial is geared toward downloading and installing git the version control system on:
Click one of the above links to be taken to the appropriate installation
section. Afterwards, please make sure to look at the configure
git section of the tutorial.
Download and Installation of
Before downloading or installing any software, it may help to have a bit of a background as to what you are obtaining. Thus, let’s briefly look at “What is git?”
- a version control system for source code
- provides an abridged history of source code changes
- allows for source code changes to be easily viewed and reverted to
- so try out new ideas without worrying about breaking something!
- a distributed versioning platform so that everyone has a backup of code
- collaborate with others without waiting for their component to be finished
- an open source (e.g. free) project that is cross platform (macOS, Windows, and Linux)
Unfortunately, unlike macOS and Linux, Windows does not currently have native
git. There are three different options for obtaining
GitHub Desktop, and
- Shell emulators
- Bash on Ubuntu on Windows / Windows Subsystem for Linux (WSL) [Requires Windows 10]
The focus of this tutorial will fall primarily on the first option with more advanced users being recommended to pursue a shell emulator, specifically WSL.
The reason why I’m opting for the first option of
is because the application is easily detected by RStudio
and plays relatively nicely with it. There are limitations with respect to
the amount of bash commands available though.
The following link will automatically start the download for the latest
Git Bash for Windows: https://git-scm.com/download/win
During the installation, there will be a section called “Adjusting your PATH environment”. On this page, make sure you select the option
“Use Git from the Windows Command Prompt”
This places the
git.exe on your system’s
PATH variable, which allows RStudio
to easily detect it. Consult the following screenshot if in doubt:
Once the installer finishes, open the Start Menu by pressing the [Windows Key]
Git Bash. Then, please proceed to the
The availability of
git on macOS occurs after installing the XCode command line tools.
To do so, open up Terminal and type:
This will yield the following prompt, which you should select
Once the installer finishes, please proceed to the configuration of
Official Instructions: https://git-scm.com/download/linux
Ubuntu / Debian
sudo apt-get install git
Fedora / CentOS / RedHat
sudo yum install git # CentOS, RedHat, <= Fedora 21 sudo dnf install git # >= Fedora 22
sudo zypper install git
To register the who component,
git must be told your name and your email.
# Specify the name and email address to be associated with your changes git config --global user.name "FirstName LastName" git config --global user.email "email@example.com"
In my case it would be:
git config --global user.name "James Balamuta" git config --global user.email "firstname.lastname@example.org"
git offers a variety of ways to customize the configuration.
By default, the following options have been set by
git; however, if you find them
problematic you can change them:
# Specify the editor to write commit and tag messages (e.g. nano, vim) git config --global core.editor vi # Colored terminal text (change to false if colorblind) git config --global color.ui true
Other introductory options can be found here: https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration
Did you forget to introduce yourself?
If during your first commit, you received:
*** Please tell me who you are. Run git config --global user.email "email@example.com" git config --global user.name "Your Name" to set your account's default identity. Omit --global to set the identity only in this repository.
You forgot to introduce yourself to
git! So, go on… Introduce yourself!