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

后端 未结 13 1727
遥遥无期
遥遥无期 2020-12-12 19:08

I am trying to deploy octopress on github pages. I followed these instructions:

http://octopress.org/docs/deploying/github/

It all worked well until the comm

相关标签:
13条回答
  • 2020-12-12 19:45

    This is not an error message from the remote Git repository, this is a problem with your local files. You probably used git (or rake) as another user (such as root) in this same directory, and it created files which you now can't overwrite.

    Simply use chown to change the ownership of the files to your current user, for instance:

    chown -R $(whoami) .
    
    0 讨论(0)
  • 2020-12-12 19:51

    I had a similar issue on Windows while running Visual Studio and File Explorer. Closing them resolved the issue.

    0 讨论(0)
  • 2020-12-12 19:56

    I solved it by deleting .git/COMMIT_EDITMSG. Weird, I know.

    0 讨论(0)
  • 2020-12-12 19:57

    In my case, the reason is that the current user(A) is not COMMIT_EDITMSG file owner(B), change current user to B and commit again. sudo su B

    0 讨论(0)
  • 2020-12-12 20:00

    If you're using TortoiseGit, you may have a Commit dialog already open

    0 讨论(0)
  • 2020-12-12 20:01

    If you are using linux. go to

    cd /applicationname/.git
    ls -al
    

    You will see user of COMMIT_EDITMSG file

    Go to root directory

    sudo su
    chown youruser: COMMIT_EDITMSG
    

    You are all set! Hope this helps

    0 讨论(0)
提交回复
热议问题