If you are asking if there is a way to make these commands:
$ git add . $ git commit -m 'commit message'
in a single command, then there is. Git developers are so smart they always think about this. Basically, you predefine the one line command that will perform both command add
and commit
using Git global alias.
$ git config --global alias.addcommit '!git add . && git commit'
Then use it like this,
$ git addcommit -m 'commit message'
Neat huh?
Happy coding and cheers!