About fatal: could not open '.git/COMMIT_EDITMSG': Permission denied

I am having the same problem like:

this thread

  • How to make a script to perform git pull?
  • git hooks bash — getting the commit message
  • How can I reject git pushes on an origin repo from a local repo if it does not pass unit tests?
  • Very basic git batch in Windows 7
  • quitting git log from a bash script
  • Error authenticating Github using Travis CI
  • when I tried the given answer:

    chown --recursive $(id -u) .
    

    in my git bash, and after I tried to commit I still have the problem. If I run:

    chown --recursive $(id -u) 
    

    (Notice that the dot is not there) I got the following message:

    chown: missing operand after '197609'
    

    What does it mean? That the missing operand is the dot?

    Why “chown –recursive $(id -u) .” is not solving the problem? What other things can I do?

    Thanks for your help

  • Fastest way to merge branches via gitlab (or git)?
  • octopress the first commit
  • Installing git & gitlab on debian wheezy
  • Should change to code be committed separately from corresonding change to test suite?
  • How do I include library from github in python project without pip?
  • Merging subtree changes - fatal: invalid path 'somefile_BASE_20704.cs'
  • Git Baby is a git and github fan, let's start git clone.