【发布时间】:2018-12-26 12:20:33
【问题描述】:
我使用的是 Windows 10。当我键入命令“git add”时。在我的 Git Bash 中,我不断收到这条消息,如下所示:
warning: could not open directory 'AppData/Local/Application Data/': Permission denied
warning: could not open directory 'AppData/Local/ElevatedDiagnostics/': 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/Temporary Internet Files/': 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
【问题讨论】:
-
您当前的工作目录是什么?
C:\Users\<username>?恐怕你在错误的路径上使用Git命令很长时间了...... -
@GenoChen 一定是这样的
%UserProfile% -
@iBug 同意。这些文件夹很可能是 Windows 下的主目录。
-
@GenoChen 非常感谢您的回复 /c/Users/Mateo
-
@MateoChiyangi 就是这样。为什么要在这条路径上执行 Git 命令...?