Python for Entrepreneurs Transcripts
Chapter: Digging Further into Git
Lecture: Git add
0:01 We learned the conceptual idea behind "git add" and "git commit".
0:03 Let's dive back into the command line, so we can test out the Git add command.
0:07 I am in the Python For Entrepreneurs course demos Git repository.
0:11 But there is nothing that's changed in this repository
0:13 so when I run the "git status" command it tells me that there is nothing to commit.
0:17 This repository contains all the source code for the entire course
0:20 and if you look at all the directories, you'll see the example code,
0:23 for each of the chapters, now this chapter on Git doesn't have any example code
0:27 but I am going to add some resources that I think are really useful
0:30 when you're getting started with Git.
0:32 I am going to create a new directory, this will be for chapter six,
0:37 we'll move in, and I am going to create a resources file.
0:43 We'll just add a single resource to this file for now,
0:47 that way we can test the "git add" command.
0:56 This is just a link to the Full Stack Python source control
0:59 page that has many resources, not only for Git
1:02 but for the general source control concept as well.
1:05 We'll save this file and then quit out and now when we type "git status",
1:08 we'll see that we have a single file that needs to be changed,
1:11 but it seems a little odd, it's not pointing to this specific file
1:14 that we just created resources.markdown, what Git is telling us
1:17 is that there is actually a new directory that has files within it that needs to be added,
1:21 I'll move up one directory, and now I'll explicitly specify
1:25 we want to add the Git resources directory.
1:28 When we type "git status", we'll see that there is a new file in a new directory
1:31 that needs to be committed to the repository.
1:34 We've set up the file for staging, what happens if we accidentally added this
1:37 to our staging area, that is where the "git reset" command comes in handy,
1:41 we can type "git reset HEAD" and now, we're back to where we were before,
1:45 there is a new directory, a new file, but they are not in the staging area.
1:49 We'll add this again and this time we'll use the period, which says
1:52 add every single change that is from this directory
1:55 and every subdirectory within this directory.
1:58 "git status" command, and now we're ready to commit this file
2:02 and the new directory, but we'll handle that in the next video.