Why the question mark? Either it gives you an error (and in this case, please provide also the entire error message) or not.
I guess, you invoked
git commit m "Test for commit message"
which is wrong. Either use
git commit -m "Test for commit message"
# or maybe better to understand and learn the commands and options
git commit --message "Test for commit message"
But because the commit message is also an important part of the commit, I recommend you to invoke it directly with
which will open your editor and you can add a multiline commit message.
Please check, that
git config core.editor
is set to your preferred editor.
If you prefer “Gedit”, you can set it
# only for the current git repository
git config core.editor "gedit"
# or set it globally for all repositories
git config --global core.editor "gedit"