git

Overview

git is a tool for version control and collaboration. It is the tool used by data science teams big and small to keep track of code. Think of it like track changes in Word or Google docs, but for code files.

You will also need an account on Github. Please create one here.

git on Windows

Follow these step-by-step instructions if you’re installing Git on a Windows machine:

First, launch a web browser, the image below shows the Microsoft Edge browser.

Next, navigate to the following Git download URL in your browser https://git-scm/com/downloads.

Select “Windows” from the Downloads portion of the Git webpage. Git will display the following page and automatically being downloading the correct version of the Git software. If the download doesn’t start automatically, click on the “Click here to download manually link.”

When the download is complete, open/Run the downloaded file (it may look different in different browsers).

A screen will appear asking for permissions for the Git application to make changes to your device. Click on the Yes button.

Click Next to accept the user license.

Leave the default “Destination Location” unchanged (usually C:\Program Files\Git) and hit Next

You will see a screen like the one below asking you to “Select Components.” Leave all of the default components selected. You can also check the boxes next to “Additional Icons” and it’s sub-item, “On the Desktop” if you would like. Your completed configurations window should have the following components selected:

Additional Icons 
    -> On the Desktop
Windows Explorer integration
    -> Git Bash Here
    -> Git GUI Here
Git LFS (Large File Support)
Associate .git* configuration files with default text editor
Associate .sh files to be run with Bash

The next screen will ask you to pick a “default editor, click the drop down box and select"Use the Nano editor by default.” The press Next.

On the next screen, it will ask to override the default “branch name.” Select the “Override the default branch name for new repositories” option, and in the text box type “main.” Press Next.

The next screen will ask you if you want to adjust your path environment. Leave the default of “Git from the command line and also from 3rd-party software.” Press Next.

On the next screen, keep the default option of “Use bundled OpenSSH.” Press Next

On the next screen, keep the default option of “Use the OpenSSL library.” Press Next.

Leave the default “Checkout Windows-style, commit Unix-style line endings” selected on the next page and hit Next:

Keep the default “Use MinTTY (the default terminal of MSYS2)” selected on the “Configuring the terminal emulator to use with Git Bash” window and hit Next:

Keep the default value of “Default (fast-forward or merge)” on the “Choose the default behavior of ‘git pull’” page and hit Next:

Keep the default value of “Git Credential Manager Core” on the “Choose a credential helper” page and hit Next:

Keep the default values on the “Configuration extra options” page by keeping “Enable file system caching” checked and “Enable symbolic links” unchecked and then hit Next:

Make sure that no options are checked in the “Configuring experimental options” page and hit Install:

After you hit this Install button as per above, you will see an install progress screen like the one below:

When the install is complete, a new, “Completing the Git Setup Wizard” window like the one below will appear:

Make sure that all of the options on this window are unchecked as in the image below and then hit the Finish button:

This will complete your installation process. Type in git --version to check if everything was installed correctly. If you see git version <NUMBERS> you’re all set. Now we need to configure some settings. Right click on your desktop, and click on “Git Bash here.” A black terminal window will open.

Click on the window, and then copy the following and press enter, changing “Jane Doe” to your name. You must put your name in quotes. git config --global user.name "Jane Doe"

Lastly, copy the following and press enter, changing the email to your email address. git config --global user.email jdoe@example.com

git on Mac

To install git on a Mac, first open the launchpad by pressing F4 or by making a pinch motion on the track pad with three fingers and your thumb.

A terminal window will open up, showing your account name and then a $, with a flashing cursor afterwards. You will enter text here to issue commands.

Enter type in the word git and press enter.

A window will pop up, asking if you want to install “developer tools.” Click Install.

A prompt will appear asking you to agree to the license agreement, click Agree.

The software will then start installing. It will take a few minutes to finish. When it is done you will see the following window. Click Done.

To make sure everything is installed correctly, go back to the terminal window and enter git --version. You should see a message that says git version <NUMBERS>. If you do, you can move on.

Next we will need to set up some options. Fist, copy the following into the terminal and press enter to change the default branch name: git config --global init.defaultBranch main

Next, copy the following and press enter, changing “Jane Doe” to your name. You must put your name in quotes. git config --global user.name "Jane Doe"

Lastly, copy the following and press enter, changing the email to your email address. git config --global user.email jdoe@example.com

Thanks to the UC Davis DataLab’s Install Guide for providing a portion of this guide.