 Another tool that really comes in handy as you start working with code is called Git, G-I-T. It's a version control program. What that means is it takes snapshots of groups of files as you're working on them, and you can take as many snapshots as you want, and then if you ever decide that you made a mistake and you need to step back a few steps, you can work your way back through that stack of snapshots and go to an earlier one. Very useful for keeping track of your own work. It's even more useful when you're working with two or five or a hundred other people on the same set of code, and you're all making changes and trying to merge it back together and not cancel each other's changes out. Git has excellent tools for handling all of that. It's also a really good way to share your code. If you want to do something less formal than sharing it on the pypy.org, the Python Package Index, you can create a Git repository and share that either directly or through websites like github.com or gitlab.com. To download Git for Windows, you can... The easiest way is just to internet search Git download. Git-scm.com slash downloads. We'll get you there. And this is a very nice, nicely put together download. You click on the Windows, it starts downloading. You save this .exe to your machine. When it's done, you double click it and run it. It's probably stored in your downloads folder. And then you can step through the installation dialog. There are a few options here that we need to pick, so we'll go through the screens one at a time. Except the new general public license. The default folder is fine. I had to create the folder if it doesn't exist. If it does exist, in my case it does, don't worry about it. The default component selection. Make sure that git bash, git GUI, and Windows Explorer integration are checked. Also, I like to associate git configuration files with a default text editor and associate .sh files to be run with bash. You can create a start menu folder if you want. Here you get an option to choose the default editor used by Git. There are a number of options here. I really like lightweight, small programs with no more features than you need. To get a very simple text editor, I'm going to go down and select other editor as Git's default editor. And then I'm going to navigate down from the C drive to the program files directory to the Windows NT directory to the accessories directory where there's a text editor called wordpad.exe. Now, anytime git needs to do something text editing, it'll pull that up. You can change the name of the initial branch in a new repository. I really like to start with mine named main. I like the name main. It's very short. It's easy to type and very neutral. Here's an option about what happens at the command line. You can actually change where your system looks for certain commands. So the middle option says, hey, from your command line, you'll be able to do all the git commands. This is good. It's a great default thing to do. If you want the final option, use git and optional Unix tools from the command prompt. If you happen to already be familiar with bash style command line, like typing ls instead of dir to get your files listed, then you'll probably want to select this. And this will let you work from the command line as if most of the things as if you were working from bash. This is a matter of personal preference. For here, for now, we'll leave the middle option selected so we won't be able to ls at the command line. We won't be able to use our bash commands. We'll still be using the windows style dir and other windows commands there. The default open SSL library option is great. The default first of these three options is great. It says in anything I have a strong opinion on. We've been spending a lot of time with the console window, so let's use the console window. The default behavior of git pull here is just fine. Git credential manager works great. Enable file system caching, that's great. We don't need to do any configuring experimental options here. And then we sit back for a couple of minutes while it installs git on our computer. And then we're done. Now to test this, we can go back to our command prompt and type git. Unfortunately, it's not recognized. So that's when we remember we have to close the command prompt, open a fresh command prompt window and type git. Now we see a list of a whole bunch of commands that can be used with git. And this should give you a sense of all of the things that it can do. It is a very powerful tool. It's in fact so powerful that it's easy to get yourself in trouble with. But we'll step through a couple of the most commonly used commands here, the things that you might find helpful. If we want to start tracking a group of files and taking snapshots of them, this group is called a repository. We need to create a directory to hold that repository. So to do that, we type git init. And then the name of the repository we want to create, a git repository. And we can check and see, yes, that directory to hold the repository was created. We can change directories and go down into it, see what's there, and it's empty. This is good. Now this directory, a git repository, and all of its subdirectories will be naturally included as part of this repository. The set of files that get snapshotted in git. To see how this works, we'll go and copy our file, hello.py, and add it to our repository. We copied and pasted hello.py here. We can see it when we type dir. Our next step is to add it to the collection of files that get snapshotted. To do that, we type git add and the name of the file. So now it's being tracked. It's included in the repository snapshots. To take a new snapshot called a commit, we type git commit-am and then in quotes a message that explains what this change is. So here we'll just explain file added. But this can be anything you want it to be, and it can be as descriptive as you want. The more descriptive, the better. Commit means take a snapshot of all the files that we've queued up for tracking. Dash A means include all of the changes that are waiting to be included. Adding the M means include this message, which is the message that we have in quotes. Now unfortunately, the very first time we do this, we get an error. It says, wait, wait, wait, I need to know who you are. This is because git keeps track of who makes these snapshots. So I have to run these two lines, git config-global, user.email, and then I add my email address. And then git config-global, user.name, and then I add my name. This is the information then that will be included with this commit, with this snapshot. Now I can go back and try that git commit again. git commit-am quote file added quote. And we get a nice little message here. The file was added, one file changed. This is lovely. If we want to see a history of what we've done, git log is a helpful way to summarize that. Because we only have one snapshot, one commit, there's only one entry in this list, but it shows the commit and then a very nonsensical string of numbers and letters. That's the name of the commit. Because it's so long, we're almost guaranteed that there will never, ever be another commit that has that name in this repository. So it's unique. That's really helpful. This snapshot is one of a kind, and this will help us always call it by its right name and get the one that we're after. And then the information that I just provided, my name and email is included there as author, and then also information about when this happened. Also the little explanatory note that we added, file added, is included there as well. You can imagine if you had a long list of these with nice informative messages with each one, it would read like a history of this repository that you're creating, this collection of files. It's a wonderful way to share with someone else the history of what you've done as well so they can look through the code and track the changes over time and see how the code has evolved. As we've mentioned before, this is a fantastic way to share a chunk of code that you've written as well or to get code from other people. If you have this snapshot, a Git repository, you can just pass that entire repository to them and they have the whole snapshot at once. And there are a couple of websites, github.com and gitlab.com, that are dedicated to doing exactly this in a nice, intuitive way. And these are things that are going to come up a lot in projects that you work on in the future.