Setup: Git Installation
Overview
Git is a version control software framework that will run behind the scenes, tracking your additions, updates, and deletions to your project files and folders. You will use git to commit files to your tracked projects and push/upload your work to your GitHub, remote repository.
If you already have Git installed on your system, you are good to go. To check if you have the latest version of Git installed, open up your command line inferface (CLI) and run
git --version
Instructions
Watch: 🎦 What
is Git?
Install Git on your computer
Select only one of the following instruction sets depending on your operating system of Windows, Mac, or Linux.
Windows Users
- Before downloading Git, check to make sure you don't already have
Git installed on your computer.
- Open a command prompt by clicking the Start button and typing
cmd
in the search box. You should get the command prompt terminal to open.Alternatively, in VS Code, you can use the terminal panel to complete any command line task. use the
Ctrl+`
keyboard shortcut to toggle the terminal panel. - Enter the following command and then press Enter:
git --version
- If you see a version number, you already have Git installed. If you don't see a version number, you need to install Git.
- Open a command prompt by clicking the Start button and typing
- To install Git for Windows. Go to git-scm.com/downloads and select Download for
Windows.
An .exe file will be downloaded. - Double click that .exe file to open and run the installation executable. The process
of installing Git will start.
- Allow the installer to make changes to your computer.
- Click Next through all of the setup windows, leaving all the defaults. There will be many windows.
- The last window will let you click Install and then click Finish.
- Open up a new Command Prompt window by closing the first Command
Prompt window and start a instance by clicking the Start button and typing
cmd
in the search box. - Enter the
git --version
command and then press Enter to see if Git is installed. You should see the version number. - While we are still in the Command Prompt, we will type in two more commands to set
up our username and email that are associated with our GitHub account. Again, it
doesn't matter what the path prompt is. These are global settings so you can type them
from any path prompt.
Make sure you use your own username and email between the "" quotes. Use the username and your email you used for the GitHub account. It will be different for everyone.
- Type in this command to set the global git username:
and click Enter. Nothing will happen if you did it right. If you get an error, you need to fix it.git config --global user.name "yourusername"
- Enter this command to set the email:
Nothing will happen if you did it right. If you get an error, you need to fix it.git config --global user.email "youremail@"
- Type in this command to set the global git username:
Demonstration: 🎦 Windows Git
Installation
macOS Users
- Before downloading Git, check to make sure you don't already have
Git installed on your computer.
- Select the Search icon (it looks like an magnifying glass) on your screen near the top right of your screen.
- Type in
"Terminal"
and open the Terminal application. It doesn't matter what path our command prompt is showing. All the commands we type will work anywhere. - Type in
git --version
at the prompt and click Enter. - You should now either see a git version number come up or a pop up window that
says something about
'The git command requires the command line developer tools ...'
. If you have a version number come up, you already have git installed and you don't need to install it. (But you will want to set your config setting as shown below.) If you get the pop-up message, click Install and Agree. - The installation may take quite a few minutes. You will get a set of development tools, which includes Git.
- Type in
git --version
at the prompt and click Enter. You should now see the version number. - While we are still in the command prompt, we will type in two more commands to
configure our username and email that are associated with our GitHub account.
Again, it doesn't matter what the path prompt is. These are global settings so you can
type
them from any path prompt.
Make sure you use your own username and email between the "" quotes. Use the username and your email you used for the GitHub account. It will be different for everyone.
- Type in this command to set the global git username:
and click Enter. Nothing will happen if you did it right. If you get an error, you need to fix it.git config --global user.name "yourusername"
- Enter this command to set the email:
Nothing will happen if you did it right. If you get an error, you need to fix it.git config --global user.email "youremail@"
- Type in this command to set the global git username:
- If you want to check the global configurations, you can always type
and you can see the user.name and user.email should have your new username and email values. Don't worry about all the other configurations.git config --list
Demonstration: 🎦 Git Install for
Mac
Linux Users
- Guide: Linux Git Install
- Install Git with the link above and then follow the last few steps from the Windows or Mac instructions to set up your global config username and email settings to match your GitHub account.