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
- [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
-
-
-
-
-
-
Set up a remote repository2m 31s
-
(Locked)
Fork the course repository1m 13s
-
(Locked)
Clone the remote repository2m 30s
-
(Locked)
Create a file and stage it2m 19s
-
(Locked)
Commit a file1m 18s
-
(Locked)
Push the file to the remote repository55s
-
(Locked)
Pull changes from the remote repository1m 37s
-
(Locked)
Initialize a repository locally and sync it3m 19s
-
(Locked)
Challenge: Push your first code42s
-
(Locked)
Solution: Push your first code57s
-
-
-
-