I was able to commit fine yesterday. But today (I didn't change anything), when I commit:
$ git add config.h
$ git commit -m "Update config.h to reset the values"
error: Couldn't set refs/heads/master
fatal: cannot update HEAD ref
I know that this error may happen also during pull or push. But I haven't found a solution to fix it when committing.
My .git/config file looks like this:
[core]
    repositoryformatversion = 0
    filemode = false
    bare = false
    logallrefupdates = true
    symlinks = false
    ignorecase = true
    hideDotFiles = dotGitOnly
[remote "origin"]
    url = git@SOME_URL
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master