gitworkshop

Instructions and details for a git workshop

View on GitHub

MacOS

Installing git

The easier way to install Git is to use Xcode Command Line Tools. If you are using Maverics (10.9) or above this is all you need to do:

  1. Open a terminal on your Mac (video)
  2. Type the following command, and press enter:
    git --version
    

    If you are given a version then that’s it, if not you should get a pop-up window asking you to install XCode.

    • Click on ‘Install’ and that’s it.

Text editor

nano should be already available on your Mac.

  1. Open a terminal on your Mac
  2. Type the following command:
    nano
    

    Your terminal is now a text editor! If it looks like their website then you are good to go!

  3. To exit the editor and go back to the terminal type: ctrl+x

We will also use VS Code. Follow these instructions to get VS Code on your mac.

  1. Download VS Code
  2. Double-click on the downloaded archive to open
    • Drag VSCode.app to the Applications folder.
  3. Git should be integrated without any further settings
  4. You should be able to open it from the terminal by:
    code <filename>
    

    If you get an error message saying that the command was not found, then do the following

    1. run (on the same or in a new terminal):
      echo $0
      
      • does it say zsh. Then run on the same terminal copy and paste this whole block:
        cat << EOF >> ~/.zshrc
        # Add Visual Studio Code (code)
        export PATH="\$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
        EOF
        
      • if it says -bash, then copy/paste this other block
        cat << EOF >> ~/.bash_profile
        # Add Visual Studio Code (code)
        export PATH="\$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
        EOF
        

        You can find more details about this and other setup for running VS Code on macOS at their official documentation.