Setting up

To participate in the workshop, you will need access to software as described below. In addition, you will need an up-to-date web browser.

1 The Bash shell

The default shell in Mac OS X Ventura and newer versions is Zsh, but Bash is available in all versions, so no need to install anything. You access Bash from the Terminal (found in /Applications/Utilities). You can also find it using Spotlight search: press Command + Space and type “Terminal”. You may want to keep Terminal in your dock for this workshop.

To see if your default shell is Bash type echo $SHELL in Terminal and press the Return key. If the message printed does not end with ‘/bash’ then your default is something else, you can change your current shell to Bash by typing bash and then pressing Return. To check your current shell type echo $0 and press Return.

To change your default shell to Bash type chsh -s /bin/bash and press the Return key, then reboot for the change to take effect.

To change your default back to Zsh, type chsh -s /bin/zsh, press the Return key and reboot.

To check available shells, type cat /etc/shells.

  1. Download the Git for Windows installer.
  2. Run the installer and follow the steps below:
    1. Click on Next four times (two times if you’ve previously installed Git). You don’t need to change anything in the Information, location, components, and start menu screens.
    2. From the dropdown menu Choosing the default editor used by Git, select Use the Nano editor by default (note: you will need to scroll up to find it), then click on Next.
    3. On the page that says Adjusting the name of the initial branch in new repositories, ensure that Let Git decide is selected. This will ensure the highest level of compatibility for our lessons.
    4. Ensure that Git from the command line and also from 3rd-party software is selected and click on Next. (If you don’t do this, Git Bash will not work properly, requiring you to remove the Git Bash installation, re-run the installer and to select the Git from the command line and also from 3rd-party software option.)
    5. Select Use bundled OpenSSH.
    6. Ensure that Use the native Windows Secure Channel Library is selected and click on Next.
    7. Ensure that Checkout Windows-style, commit Unix-style line endings is selected and click on Next.
    8. Ensure that Use Windows’ default console window is selected and click Next.
    9. Ensure that Default (fast-forward or merge) is selected and click Next.
    10. Ensure that Git Credential Manager is selected and click on Next.
    11. Ensure that Enable file system caching is selected and click on Next.
    12. Click on Install.
    13. Click on Finish or Next.
  3. If your “HOME” environment variable is not set (or you don’t know what this is):
    1. Open command prompt (Open the Start Menu, then type cmd and press Enter)
    2. Type the following line into the command prompt window, exactly as shown: setx HOME "%USERPROFILE%"
    3. Press Enter and you should see SUCCESS: Specified value was saved.
    4. Quit the command prompt by typing exit then pressing Enter.

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

The default shell is usually Bash and there is usually no need to install anything.

To see if your default shell is Bash type echo $SHELL in Terminal and press the Return key. If the message printed does not end with ‘/bash’ then your default is something else, you can change your current shell to Bash by typing bash and then pressing Return. To check your current shell type echo $0 and press Return.

To change your default shell to Bash type chsh -s /bin/bash and press the Return key, then reboot for the change to take effect. To change your default back to Zsh, type chsh -s /bin/zsh, press the Return key and reboot. To check available shells, type cat /etc/shells.

2 Git

Git is a version control system that lets you track who made changes to what when and has options for easily updating a shared or public version of your code on github.com. You will need a supported web browser.

You will need an account at github.com for parts of the Git lesson. When setting up your GitHub account, please consider what personal information you’d like to reveal. For example, you may want to review these instructions for keeping your email address private provided at GitHub.

Important

Your device should come with Git pre-installed. Only follow the video instructions if you do not have Git installed on your device.

  1. Open Terminal (you can find it using Spotlight search - press Command + Space and type “Terminal”)
  2. Type git --version and press Return
  3. If you see a version number (like git version 2.39.2), Git is already installed and you’re all set
  4. If you see an error or no version number, proceed with the instructions to install the “command line developer tools”. Do not click Get Xcode, because that will take too long and is not necessary for our Git lesson. After installing these tools, there won’t be anything in your /Applications folder, as they and Git are command line programs.

For older versions of OS X (10.5-10.8): use the most recent available installer labelled “snow-leopard” available here. (Note: this project is no longer maintained.) Because this installer is not signed by the developer, you may have to right click (Control + click) on the .pkg file, and then click Open in the pop-up dialog. You can watch the video tutorial below for this.

Git should be installed on your computer as part of your Bash install.

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 dnf install git.

3 Text editor

When you’re writing code, it’s nice to have a text editor that is optimized for writing code, with features like automatic color-coding of key words. The default text editor on macOS and Linux is usually set to Vim, which is not famous for being intuitive. If you accidentally find yourself stuck in it, hit the Esc key, followed by : + q + ! (colon, lower-case ‘q’, exclamation mark), then hitting Return to return to the shell.

In this lesson, we will be using the text editor nano. For a deeper dive into nano, refer to our Text editors: nano guide.

nano is a basic editor and the default that instructors use in the workshop. See the Git installation video tutorial, also provided below, for an example on how to open nano. It should be pre-installed.

nano is a basic editor and the default that instructors use in the workshop. It is installed along with Git.

nano is a basic editor and the default that instructors use in the workshop. It should be pre-installed.

Alternatively if you wish to use Vim, refer to our Text editors: Vim guide.

4 For instructors

There is a list of common issues that occur during installation, as a reference for instructors, that may be useful in the following wiki page: Configuration Problems and Solutions.