Git Commit - Complete Guide to committing your files in GIT CLI

Committing the staged files in your repo

To commit all the staged fields, you can use the following command by adding a commit_message.

git commit -m "<commit_message>"

For e.g., git commit -m "fix: errors in console"

Committing the modified files only(which are tracked)

To commit all the local changes in the tracked files i.e.,files which are committed in previous commit and are modified. You can use the following command:

git commit -a

The above command doesn't have a commit_message, so the the GIT CLI will open vi editor to ask you the commit message. You need to know how to use the vi or vim to use the above command. If you're not familiar with vim, them use the below command which includes the commit message.

Committing the modified files only(which are tracked), with commit message incl.

git commit -am "<commit_message>"

Last Updated on

Next Post: GraphProtocol: TS2322 null assignment in Subgraph →