Python for Entrepreneurs Transcripts
Chapter: Digging Further into Git
Lecture: Git add

Login or purchase this course to watch this video and the rest of the course contents.
0:01 We learned the conceptual idea behind "git add" and "git commit". Let's dive back into the command line, so we can test out the Git add command.
0:08 I am in the Python For Entrepreneurs course demos Git repository. But there is nothing that's changed in this repository
0:14 so when I run the "git status" command it tells me that there is nothing to commit. This repository contains all the source code for the entire course
0:21 and if you look at all the directories, you'll see the example code, for each of the chapters, now this chapter on Git doesn't have any example code
0:28 but I am going to add some resources that I think are really useful when you're getting started with Git.
0:33 I am going to create a new directory, this will be for chapter six, we'll move in, and I am going to create a resources file.
0:44 We'll just add a single resource to this file for now, that way we can test the "git add" command.
0:57 This is just a link to the Full Stack Python source control page that has many resources, not only for Git
1:03 but for the general source control concept as well. We'll save this file and then quit out and now when we type "git status",
1:09 we'll see that we have a single file that needs to be changed, but it seems a little odd, it's not pointing to this specific file
1:15 that we just created resources.markdown, what Git is telling us
1:18 is that there is actually a new directory that has files within it that needs to be added, I'll move up one directory, and now I'll explicitly specify
1:26 we want to add the Git resources directory. When we type "git status", we'll see that there is a new file in a new directory
1:32 that needs to be committed to the repository. We've set up the file for staging, what happens if we accidentally added this
1:38 to our staging area, that is where the "git reset" command comes in handy, we can type "git reset HEAD" and now, we're back to where we were before,
1:46 there is a new directory, a new file, but they are not in the staging area. We'll add this again and this time we'll use the period, which says
1:53 add every single change that is from this directory and every subdirectory within this directory.
1:59 "git status" command, and now we're ready to commit this file and the new directory, but we'll handle that in the next video.


Talk Python's Mastodon Michael Kennedy's Mastodon