运行git add时权限被拒绝

时间:2019-03-10 18:42:54

标签: git permissions permission-denied

当我运行代码时:

git add。

我明白了:

warning: could not open directory 'AppData/Local/Application Data/': Permission denied
warning: could not open directory 'AppData/Local/History/': Permission denied
warning: could not open directory 'AppData/Local/Microsoft/Windows/INetCache/Content.IE5/': Permission denied
warning: could not open directory 'AppData/Local/Microsoft/Windows/INetCache/Low/Content.IE5/': Permission denied
warning: could not open directory 'AppData/Local/Microsoft/Windows/Temporary Internet Files/': Permission denied
warning: could not open directory 'AppData/Local/Temp/RarSFX0/packages/': Permission denied
warning: could not open directory 'AppData/Local/Temporary Internet Files/': Permission denied
warning: could not open directory 'Application Data/': Permission denied
warning: could not open directory 'Cookies/': Permission denied
warning: could not open directory 'Documents/My Music/': Permission denied
warning: could not open directory 'Documents/My Pictures/': Permission denied
warning: could not open directory 'Documents/My Videos/': Permission denied
warning: could not open directory 'Local Settings/': Permission denied
warning: could not open directory 'My Documents/': Permission denied
warning: could not open directory 'NetHood/': Permission denied
warning: could not open directory 'PrintHood/': Permission denied
warning: could not open directory 'Recent/': Permission denied
warning: could not open directory 'SendTo/': Permission denied
warning: could not open directory 'Start Menu/': Permission denied
warning: could not open directory 'Templates/': Permission denied
error: open(".gradle/wrapper/dists/gradle-4.10.1-all/455itskqi2qtf0v2sja68alqd/gradle-4.10.1/samples/plugins/multiproject/maven-repo/org/gradle/sample/goodbye/org.gradle.sample.goodbye.gradle.plugin/1.0.0/org.gradle.sample.goodbye.gradle.plugin-1.0.0.pom.md5"): Filename too long
error: unable to index file '.gradle/wrapper/dists/gradle-4.10.1-all/455itskqi2qtf0v2sja68alqd/gradle-4.10.1/samples/plugins/multiproject/maven-repo/org/gradle/sample/goodbye/org.gradle.sample.goodbye.gradle.plugin/1.0.0/org.gradle.sample.goodbye.gradle.plugin-1.0.0.pom.md5'
fatal: adding files failed

有人可以建议我如何解决它吗?

1 个答案:

答案 0 :(得分:0)

我现在可以想到的两件事:

  1. 第一个是您正在初始化的git文件夹之外运行git add命令。您运行git init吗?
  2. 可能是您可能需要关闭正在处理的项目然后尝试添加,因为有时ide,编辑器或所做的任何工作都可能阻止文件,因此git无法访问这些文件。