Leah is the executive director of pyOpenSci .
Data Science Skills
Git Started: Setup Bash & Git
Leah Wasser, Jenny Palomino, February 12, 2023 | 3 min ReadTable 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
andGit
. - Open a terminal and test that
Bash
,Git
are running properly on your machine.
Bash Setup
- Mac OS X
- Linux
- Windows
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:
- Click on “Run”.
- Click on “Next”.
- Click on “Next”.
- Click on “Next”.
- Click on “Next”.
- Click on “Next”.
- 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.
- Click on “Next”.
- Leave the selection on “Checkout Windows-style, commit Unix-style line endings” and click on “Next”.
- Select the second option for Use Windows’ default console window and click on “Next”.
- Click on “Next”.
- Click on “Install”.
- 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
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.
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.