git commit
Before we create our very first commit, let's run a git status check to verify what we're working with.
git status
On branch master
No commits yet Changes to be committed: (use "git rm --cached <file>..." to unstage)
new file: file-3.txt
new file: project-1.txt
Untracked files: (use "git add <file>..." to include in what will be committed)
file-2.txt
One of our files file-2.txt, does not seem to be staged. Let's stage it.
git add . git status
On branch master
No commits yet Changes to be committed: (use "git rm --cached <file>..." to unstage)
new file: file-3.txt
new file: project-1.txt
new file: project-1.txt
all of our files are currently staged.
Making our first commit Let's make our first commit:
git commit -m "Initial Commit" The git commit allows us to create a snapshot of the current working directory.
The -m flag, allows us to write our message within our terminal.
Our message "Initial Commit", is the message used to describe the commit snapshot.