I often forgot that I have some new files and directly do,
git commit -a -m \"My commit message\"
This only commits changed files, and I ha
It's not possible using the default git
interface. However, git
supports aliases.
Using an alias, it's possible to invoke a different git command, or even run arbitrary shell scripts. Create a script containing the two commands, and alias it.
See the wiki for more information on aliases, and this question for this specific scenario.
Edit: note that this is not such a good idea. The chances are you'll end up adding unnecessary files by mistake, or having a useless alias due to non-versioned files in the tree.