Explain the difference between git add and git commit.?
- git add: This command stages changes, telling Git which modifications you want to
include in the next commit. It doesn't save the changes to the repository yet, just
prepares them.
- git commit: This actually saves the changes to the repository, creating a new entry
in your project’s history.
Real-World Example:
You’ve edited a few files in your project. First, you use git add . to stage all changes,
and then you use git commit -m "Fixed bug in homepage" to save those changes
to the repository.
Follow: