The most common Git command sequence is:
git add .
git commit -m "Message"
I have searched for a native Git command to do it with one line but surprisingly could not find it. There are at least two big threads concerned with this question HERE and HERE, but surprisingly they have high voted answers not doing the job or doing it using additional hacks.
The top voted solution in the first thread linked above suggest to define a macro
git config --global alias.add-commit '!git add -A && git commit'
which has the downside of having to do it again and again for every new software environment. The second voted solution
git commit -a -m "message"
does not work - it does not add new files! Other "solutions" involve writing the same two commands in a single line - this offers no advantage in terms of typing!
Further, Pro Git - one of the well-known books states on page 22:
2.2.7 Skipping the Staging Area
Although it can be amazingly useful for crafting commits exactly how you want them, the staging area is sometimes a bit more complex than you need in your workflow. If you want to skip the staging area, Git provides a simple shortcut. Providing the -a option to the git commit command makes Git automatically stage every file that is already tracked before doing the commit, letting you skip the git add part...
The emphasis is mine - this is indeed only works with files that are already tracked. But your new files are never tracked (or I can I change setting to make the being tracked?), so you can't have the added and committed using that command!
I am looking for a clean single line solution provided by the standard git software without additional hacks. Given so many rich advanced options of Git, it is hard to believe such a command does not exist. If there is anything I am missing here, will be happy to learn!