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:
- Open a terminal on your Mac (video)
- 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.
- Open a terminal on your Mac
- Type the following command:
nano
Your terminal is now a text editor! If it looks like their website then you are good to go!
- 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.
- Download VS Code
- Double-click on the downloaded archive to open
- Drag VSCode.app to the Applications folder.
- Git should be integrated without any further settings
- 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
- 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 blockcat << 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.
- does it say
- run (on the same or in a new terminal):