【问题标题】:Permission denied when I run git add [duplicate]当我运行 git add [重复] 时权限被拒绝
【发布时间】:2019-08-01 03:08:41
【问题描述】:

当我运行代码时:

git 添加。

我知道了:

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

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

【问题讨论】:

  • 你在哪里运行这个命令。我确定您没有指向正确的文件夹来运行 git add 命令

标签: git permissions permission-denied


【解决方案1】:

我现在能想到的可能有两件事:

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

【讨论】:

  • 我更改了目录然后它正常工作
猜你喜欢
  • 2017-11-10
  • 2016-11-16
  • 2017-12-23
  • 2016-08-24
  • 1970-01-01
  • 2016-07-08
  • 1970-01-01
  • 2013-10-10
  • 2020-02-12
相关资源
最近更新 更多