How to commit files?

git commit -m 'commit message'

To commit files use git commit -m 'commit message', which creates a new commit with the changes in your staging area, using the commit message defined with parameter -m.

Changes not in your staging area won't be commited or changed.

Layer 1
Terminal Example
git status
On branch main
Changes to be committed:
  (use "git restore --staged ..." to unstage)
    modified:   code.rb

git commit -m 'Changes in code and README'
[main c335861] Changes in code and README
 2 files changed, 2 insertions(+)

See git commit to learn more about it.

Last modified on November 30, 2021.

You might also like