Data Science Skills

We create high quality open lessons for open science.

Git Started: Setup Bash & Git

Leah Wasser, Jenny Palomino, February 12, 2023 | 3 min Read
Table Of Contents

Setup Bash / Terminal

Learn how to setup git and Bash on your computer so you can get started using git for version control and.

Learning Objectives

At the end of this lesson you will know how to:

  • Install Bash and Git.
  • Open a terminal and test that Bash, Git are running properly on your machine.

Bash Setup

  • Mac OS X
  • Linux
  • Windows
The default shell in all versions of Mac OS X is Bash, so no need to install anything. You access Bash from the Terminal (found in /Applications/Utilities). You may want to keep Terminal in your dock for this workshop.

Linux

The default shell is usually Bash but if your machine is set up differently you can run it by opening the Terminal and typing: bash. There is no need to install anything.

Download the Git for Windows installer.

Run the installer by double-clicking on the downloaded file and by following the steps below:

  1. Click on “Run”.
  2. Click on “Next”.
  3. Click on “Next”.
  4. Click on “Next”.
  5. Click on “Next”.
  6. Click on “Next”.
  7. Leave the selection on “Git from the command line and also from 3rd party software” and click on “Next”. NOTE: If you forgot to do this, the programs that you need for the workshop will not work properly. If this happens, rerun the installer and select the appropriate option.
  8. Click on “Next”.
  9. Leave the selection on “Checkout Windows-style, commit Unix-style line endings” and click on “Next”.
  10. Select the second option for Use Windows’ default console window and click on “Next”.
  11. Click on “Next”.
  12. Click on “Install”.
  13. When the install is complete, click on “Finish”.

This installation will provide you with both Git and Bash within the Git Bash program.

Git Setup

Git is a version control system that lets you track who made changes to what and when, and it has options for easily updating a shared or public version of your code on GitHub.

You will need a supported web browser (current versions of Chrome, Firefox or Safari, or Internet Explorer version 9 or above).

Git installation instructions borrowed and modified from Software Carpentry.

  • Mac OS X
  • Linux
  • Windows

Video Tutorial

Install Git on Macs by downloading and running the most recent installer for “mavericks” if you are using OS X 10.9 and higher -or- if using an earlier OS X, choose the most recent “snow leopard” installer, from this list.

After installing Git, there will not be anything in your /Applications folder, as Git is a command line program.

Data Tip

If you are running Mac OSX El Capitan, you might encounter errors when trying to use Git. Make sure you update XCODE. Read more - a Stack Overflow Issue.

If Git is not already available on your machine, you can try to install it via your distro’s package manager. For Debian/Ubuntu, run sudo apt-get install git and for Fedora run sudo yum install git.
Git was installed on your computer as part of your Bash install.
Leah Wasser

Leah Wasser

Leah is the executive director of pyOpenSci .