From the course: Git Essential Training

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Commit a file

Commit a file

- [Instructor] In the last video we added a file to the staging area. If we are not sure if there are files in that area we can always check with git status. (keyboard clicks) And we see that there is a change to be committed. The new file is example.txt. Let's commit this file locally. I will say, "git commit -m". And now I can fill out a message so I can tell whoever is viewing this history why I made a commit here or what I added. In this case, I will say, "adds example.txt". I'll press enter and my file is now committed. This means that locally a snapshot has been created of the state of this file. If I add git status now, (keyboard clicks) it will say that everything's committed, but we're still ahead of the branch on the remote repository. In the next video we will push that file to the remote repository.

Contents