Python for Entrepreneurs Transcripts
Chapter: Digging Further into Git
Lecture: Git status
Login or
purchase this course
to watch this video and the rest of the course contents.
0:01
We're going to dig into all the fundamental commands that are part of Git. You can think of commands like "git status" as the building blocks
0:08
for how to use the Git version control system; now the best way to get comfortable with these commands is
0:13
just to get to the command line and start working. At the end of the previous chapter, we cloned the Git repository
0:19
that has all the demos for this course, change into that directory if you are not already there, because we cloned
0:24
a Git repository, this is already enabled to use all the Git commands; "git status" tells us all the changes that have happened in the Git repository
0:31
since our last commit. In this case, there is nothing to commit, because we just cloned a repository, we haven't changed any files.
0:37
If we were to create a new file in this repository, then "git status" would show us that that file has not yet been committed to the index.
0:43
Let's do that now, I am going to say "touch newfile", and this is just an example of a generic file, and now if we say "git status",
0:50
it's going to say this file, newfile is untracked. Every file that is new or has modifications that has not yet been added to Git
0:57
will show up in this list. If we delete this file before it's added to the Git repository, then it will disappear from this list.
1:04
So if we remove new file, and then again we type "git status", we'll see nothing to commit, there is no list of new files or file modifications
1:13
because within this directory and all the subdirectories that Git is tracking
1:16
in this repository, nothing has been changed, that is really all there is to it, when you're working with the "git status" command.
1:22
Git status is one of those commands you don't even really think about all that much,
1:25
when you've been using Git for a long time, it just becomes an intuitive command so that you can check which files you've been working on
1:30
and what you need to add and commit to your Git repository. One handy feature you can use to get yourself familiar with all these commands
1:37
and the flags that you can set on them, is to use "git --help" and then the name of the command, so in our case, "status".
1:45
This brings up the man page that will explain what the command does and any options that are available as arguments, scroll through the page
1:52
using the space bar, and type "q" in order to escape, that is "git status", it's one of our helpful building blocks for working with Git.