Git Installation - Windows4:09 with Tommy Morgan
In this video, we'll walk you through getting Git installed on a Windows machine.
Before you install on Windows
- You might wish to install the Notepad++ text editor OR install the Visual Studio Code IDE prior to installing Git for Windows. If you do so, then when you're installing Git, you will be given additional options for the default text editor Git should use for commit messages.
Additional Windows installation notes
- Visit the Official Git Website to download Git for Windows.
- As of Git version 2.16.2, the Windows installer has changed slightly from what is shown in the video.
- You should still keep the default settings on most screens.
- A new "Select Start Menu Folder" screen has been added. Keep the default: "Git".
- A new "Choosing the Default Editor Used by Git" screen has been added.
- Do not keep the default for this one, unless you are comfortable with the "vim" text editor.
- Instead, switch to "Nano".
- Or, you can switch to "Notepad++" or "Visual Studio Code" if you have one of those installed.
- On the "Adjusting your PATH environment" screen, the "Use Git from Git Bash only" option is no longer the default. You should switch to "Use Git from Git Bash only".
- A new "Choosing HTTPS Transport Backend" screen has been added. Keep the default here: "Use the OpenSSL Library".
- A new "Configuring the terminal emulator to use with Git Bash" screen has been added. Keep the default here too: "Use MinTTY".
- A new "Configuring extra options" screen has been added. Keep all the default values here.
Using Git on Windows
- You might find, depending on how you create your files as you follow along with Treehouse lessons, that some of your filenames end in ".txt", even if the files shown in the video don't. (This will not be an issue for the Introduction to Git course, but it might for the older Git Basics course.) You can either adjust to this as you follow along, or just rename the files - the
mv file1.txt file1) can get rid of that .txt extension for you so you can follow along more easily.
Like I mentioned in the previous stage, Git was created by Linus Torvalds,
the inventor of the Linux operating system.
Because of Linus' familiarity with the POSIX file system that Linux uses,
Git has a lot of dependencies that aren't easily available to Windows.
For a while it was very difficult to get Git up and running on a Windows machine.
But I think it's safe to say that Git wouldn't have attained its current popularity
if people hadn't been able to solve that problem.
Fortunately for us, there's a simple installer available from the Git website.
Let's walk through that installation and get you ready to follow along.
At the time this video was recorded, this is what the official Git website looked like.
It's located at git-scm.com.
If anything looks different from my instructions here, be sure to check out the teacher's notes for this video for updated instructions.
First, you can see that the website recognizes that we're on a Windows PC
and directs us to the latest download for our system.
Don't worry if you're getting a different version number here.
All of the commands we're using in this lesson will work just the same.
Let's click that button.
This will download an installer package for us.
Let's run that when it's finished downloading.
We'll have to accept the license, choose an install destination—
I'd recommend just leaving the default, but if you have any strong preferences, feel free to change it.
This screen can be a little confusing.
Let's leave it as is here.
I'm also going to uncheck the Windows Explorer integration option
just because we're not going to be using it,
but feel free to leave that enabled or mess with any other options if you're comfortable.
This option will determine where the Git commands are accessible from.
I'd recommend using Git Bash only, unless you're aware of what the other options mean and have a preference.
Without getting into too much detail, Windows and UNIX systems like Linux and Mac OS X
have differing opinions about the way that files are formatted,
and if you don't account for that, you can cause some major annoyances for your teammate.
The first option here is the safest, so we'll go with that.
Now the installer is going to do its thing.
And here we go. All finished.
We don't particularly need to see the release notes.
This is what the Start menu looks like on Windows 8.
If you have an older version of Windows, just open your Start menu and look for the Git folder.
You'll note that we have 2 options here—
Git GUI and Git Bash.
Some people prefer to work in the GUI, which is fine,
but we're going to focus on the command line for now,
so we won't be using this tool.
Definitely explore it later if it interests you, though.
Git Bash, on the other hand, is a command line environment that emulates a UNIX system.
This will enable you to use the Git command line interface.
Try it out now by running git --version.
This will also be compatible with almost every command that we run in our videos,
including common UNIX commands like ls.
There is, however, one important difference if you're planning to follow along in the videos.
There will be some occasions where I edit files using the Nano text editor,
and Nano will not be available on your system.
Instead, I'd recommend using the ubiquitous Windows text editor Notepad.
So every time I type nano followed by a filename,
just type notepad followed by the filename, like so.
And everything should be great.
Hopefully your install went smoothly and everything is working.
If not, be sure to post about your problem in the forums, and somebody should be able to help you get it taken care of.
You need to sign up for Treehouse in order to download course files.Sign up