git: Unable to index file - permission denied

后端 未结 7 927
粉色の甜心
粉色の甜心 2020-12-29 02:34

Only for one file, I am getting the following error:

error: unable to write sha1 filename /opt/www/.git/objects/3f/ce3587c54a8be14c69b08c6b01f94949b11b47: Pe         


        
7条回答
  •  旧巷少年郎
    2020-12-29 03:19

    If you are using visual studio or something similar that is generating the mdf file, simply close VS & retry your git command again. This time it should work.

    To save constantly closing & reopening, you should add references into .gitignore file in the project root. For example, if it is a database causing the issue, add the following:

    # SQL Server files
    *.mdf
    *.ldf
    

提交回复
热议问题