Commit
You might say
Save the code changes I have now—I don't want things to get messy and lose this working version.
Save one meaningful set of changes in the project historyA commit records the selected changes with an author, time, and message. It should describe one understandable step so someone can review or restore it later. Creating a commit is local; it does not send anything to a remote until push runs.
Know first
Variants
git add
git add index.html
Specify the changes to be recorded in the next commit
git commit
git commit -m "Description"
After completing an independently explainable change
git log
git log --oneline
View commit history or locate a commit before reverting
git status
git status
Not sure which files were changed, ask it first
Typical use cases
Feature step
$ git add index.html
$ git commit -m "Repair button is misplaced on mobile phone"
[main e7b2d48] Fix button misplacement on mobile phone
1 file changed, 6 insertions(+), 3 deletions(-)
Bug fix
Copy update
$ git log --oneline
e7b2d48 Fix button alignment on mobile
a3f9c21 Finish the home-page navigation
b4c5d67 Home page basic version
0f1e2d3 Initialize project
The first 7 bits are a short hash that can be used to identify the commit
Refactor checkpoint
Further reading