See if any of those tips help you:
Verify if there's some file called
~/.gitconfig.lock. If that's the case just delete it.
~/.gitconfig belongs to you (use
ls -la ~/.gitconfig to check). If it does not you can change the ownership using
sudo chown <your_username>:<your_username> ~/.gitconfig
If none of these solves the problem you can always edit ~/.gitconfig using your favorite text editor. It is just a INI like file. An example:
$ cat ~/.gitconfig
name = my_username
email = firstname.lastname@example.org
editor = editor
pager = most
ui = auto
conflictstyle = diff3
I am assuming the correct location is
~/.gitconfig. If that's not the case replace it with the correct path.
Hope it helps.