Setup for Essential Git Training
Required Software
- Git
- Operating system:
- PC: Windows 10
- Mac: OS X Mountain Lion (version 10.8) or later
- Linux
- Code editor
Instructions
Installing Git
There are multiple ways to install Git on each operating system.
Linux
If you have Linux, Git usually comes pre-installed. If not, use apt-get install git on Ubuntu or yum install git on Red Hat.
Windows
Option 1: Chocolatey
If you have Windows 10, the best alternative to install Git is to use Chocolatey, a Windows package manager similar to apt-get and yum on Linux. To install Chocolatey:
- Go to https://chocolatey.org/
- Click Install Chocolately Now.
- Follow the instructions.
- To check if Chocolatey was properly set up, type choco in the terminal. You should see a line that says Chocolatey v0.10.3 or something similar.
- Finally, we can install Git by doing the following:
choco install git.install --params "/GitAndUnixToolsOnPath” - This will install the Git program, the BASH tools and add them to your path.
Option 2
- If you don’t have Windows 10 or don’t want to install Chocolatey, get the Windows installer at the Git for Windows website.
- This will install the Git program, the BASH and some GUI tools.
Mac
Option 1: Using Homebrew
The best way to install Git in Mac OS is by using Homebrew, which is a package manager similar to RedHat’s yum or Ubuntu’s apt-get. To install Homebrew:
- Go to website at https://brew.sh/.
- Open a terminal window, which you can find in the Applications > Utilities folder or by doing a search (press Command + Space and type “terminal”).
- Copy and paste this command from the Homebrew install code:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com / Homebrew / install / master / install)" - After installing, do brew doctor to see if everything is fine and then do brew update to get the latest update to the program.
- Finally, type brew install git and you should be set to start using Git.
Option 2: Using Xcode Development Tools
If for some reason you don't want to use Homebrew, and you are in Mac OS 10.9 Mavericks and above, you can install Git by using the Xcode development tools. Note that this is not the best way to install Git, since this method usually installs an older version. We recommend you use Homebrew as described in the previous section.
- Open the terminal and type git.
- You will get a prompt that says: “The “git” command requires the command line developer tools. Would you like to install the tools now?”
- Press the install button and wait for the installation to finish.
Checking if Git is installed correctly
To verify that you have Git installed, write “git” in the Git Bash (Windows) or Mac OSX terminal. You should see a list of available commands. To see what version of Git you have, just type git --version.
Courses and Class Files
This setup page is used for the following course: