From the course: Git Essential Training

Unlock this course with a free trial

Join today to access over 24,700 courses taught by industry experts.

Commit a file

Commit a file

- [Instructor] In the last video, we added a file to the staging area. In this video, we will commit this file to the local repository. So just a little bit of a refresher. We are now using Git to take the changes that are in the staging area and store them in our local repository to create a snapshot. We are back at our repository with the file example.md in our staging area. Now let's commit this file locally. And I'll use "git commit -m" followed by a message that explains why I'm committing this file. So in this example, I write, "add example.md to demonstrate the git process." Then I'll press enter, and the file is committed. This means that a snapshot of the file state has been created locally. If I check Git status, it will show that everything is committed, but we're now ahead of the remote repository. So in the next video, we'll push this file to the remote repository so it's the same as our local environment.

Contents