Downloading and Installing Git
Is Git Already Installed?
You can quickly check to see if git is installed on your computer, and which version. Simply open a terminal (or command prompt) and type the following command:
git --version
If you see a version number, then Git is already installed on your computer. If you see an error message or if your version is less than 2.40, you will need to install Git.
Installation
The following videos will walk you through the installation process. Choose the corresponding video for your operating system:
Windows 10/11
Mac
To install Git, go to https://git-scm.com/downloads and download the version for your operating system.
User Configuration
Now that Git is installed, you need to configure it with your name and email address. This information will be used to identify you when you make changes to your code.
Note
If you are on campus, using a school computer, this step is not necessary. Git will use your school email address and username.
This video will walk you through the process of configuring Git:
Show/Hide Video
You can use your school email address, or your personal email if you prefer.
Here is the command to set your user name:
git config --global user.name "Your Name"
And here is the command to set your email address:
git config --global user.email "Your Email"
Tip
You can change your name and email address at any time by running these commands again, or by modifying the .gitconfig file in your home directory.
Exercise 2
Show/Hide Video
Note
Ctrl + C and Ctrl + V do not copy & paste in Git Bash! To copy text in Bash, simply highlight it with your mouse, it will automatically be copied to your clipboard. To paste text, right-click in the terminal and select "Paste" from the context menu.
Perform the following tasks:
Open the Desktop directory using the "Open Git Bash Here" option in the context menu.
Using the terminal/bash, show which version of Git you have installed.
Copy the commands in Bash and submit them below.
Hints
How do I check the version of Git?
Run the following command in your terminal:
git --version
There is a shortcut for this command, which is git -v.
Submission
Once you have completed the exercise, paste the contents of your terminal into the text area below. Then click the "Submit Exercise" button.
Solution
Show the Answer
Right-click on your desktop and select "Open Git Bash Here".
Then run the following command:
git --version