There are many ways to change the default editor used for entering committing message to the git repository.
1 - Commit using the command line itself
$ git commit -m "my first commit"
2 - Change the editor using the command line and git command
I prefer emacs so I will use emacs as my default git commit editor.
$ git config --global core.editor "emacs"
3 - Add the editor info to the gitconfig file
$ cd $ emacs .gitconfig
Once you have opened the file add the following lines to it
[core]