2 Getting set to Git

2.1 Overview

Duration: 20 min

2.1.1 Questions

  • What tools do I need to partake in this workshop?
  • How can I install the tools I need for my platform?

2.1.2 Objectives

  • Get set up for learning git/GitHub and some command line.
  • Understand how to access the command line and git.

2.2 Software Setup

These setup instructions are adapted from instructions that are copyright Software Carpentry and made available for re-use by them under the CC BY 4.0 license.

The task here is to get you setup with 3 main components:

  • git - the version control software we will be studying
  • Atom - a text editor with good integration with git/GitHub
  • GitHub Account - access to the famed online git hosting service.

2.2.1 Git Windows

Video Tutorial

The following instructions are for git for Windows 2.19.1 installer:

  1. Download the Git for Windows installer.
  2. Run the installer and follow the steps bellow:
    1. Click on “Next” to use the default install location.
    2. Click on “Next” to use the default install components.
    3. Click on “Next” to use the default Start Menu folder.
    4. Click on “Next” to use the default editor, we will change it later.
    5. Keep “Use Git from the Windows Command Prompt” selected and click on “Next”. If you forgot to do this programs that you need for the workshop will not work properly. If this happens rerun the installer and select the appropriate option.
    6. Click on “Next” to use OpenSSL library.
    7. Keep “Checkout Windows-style, commit Unix-style line endings” selected and click on “Next”.
    8. Keep “Use Windows’ default console window” selected and click on “Next”.
    9. Keep “Enable file systen caching” and “Enable Git Credential Manager” selected and click on “Next”.
    10. Do not enable experimental updates. Click on “Install”.
    11. Uncheck “View Release Notes”. Click on “Finish”.
  3. If your “HOME” environment variable is not set (or you don’t know what this is):
    1. Open command prompt (Open Start Menu then type cmd and press [Enter])
    2. Type the following line into the command prompt window exactly as shown:
    1. Press [Enter], you should see SUCCESS: Specified value was saved.
    2. Quit command prompt by typing exit then pressing [Enter]

This will provide you with both Git and Bash in the Git Bash program. MacOS Check you can access ‘Terminal’

The Terminal can be found in /Applications/Utilities or by searching spotlight for ‘Terminal’. You may want to keep Terminal in your dock for this workshop. Git install option 1

Open the terminal and type:

$ git --version

If git is not installed you will get a prompt asking you if you wish to install it along with Xcode command line tools. You may be asked for your administrator password. Git install option 2

Download and run the installer from: https://git-scm.com/download/mac. Hit ‘Continue’ through the prompts without modifying the installation destination or other settings. You may be asked for your administrator password. Linux

Check you have git installed by opening your terminal and running:

$ git --version

If git is missing install is using your package manager. E.g. by running

sudo apt-get install git

In the terminal.

2.2.2 Atom text editor Windows, MacOS, Linux

  1. Open https://atom.io/ in your browser.
  2. Click the ‘Download’ button to download the Atom installer.
  3. Once Downloaded, run the installer to install Atom.

2.2.3 GitHub Windows, MacOS, Linux

  1. Open https://github.com in your browser
  2. Click ‘Sign up for GitHub’
  3. Enter the required personal details for step 1.
    • Note if you use a ‘.edu’ email it will be slightly easier to get unlimited private repos for free with an educational discount. Although you can change this later.
  4. In step 2 select the free plan.
  5. In step 3 you have the option to fill out a survey or immediately hit submit. Optional: Register for educational discount
  1. Open https://education.github.com/ in your browser, log in to GitHub if prompted.
  2. Click ‘Join GitHub Education’
  3. Select the category that describes you, most likely the category that describes you, most likely ‘Researcher.’
  4. Fill in the rest of your details, you will need to supply an .edu email, and a brief description of your planned GitHub usage. You might say “To version and share research projects.”