git - 使用 `git add` 将文件添加到索引时出现“权限被拒绝”
问题描述
我在使用 git 时遇到问题。我在 Visual Studio 代码中有 5000 个待定更改需要提交。这些是未上演的,但我无法上演它们以提交。我的 .git 文件夹存在于 Windows 中。我的所有项目都在我的桌面上,位于不同的文件夹中,但我只是将它们全部移动到一个名为 Projects 的文件夹中,该文件夹位于我的桌面上。我试过 cd 进入这个文件夹,但没有运气。当我输入时git add -A
,我得到了这个
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
抱歉,如果我对我在寻找什么有点不清楚,我是 git 和 github 的新手。我只想提交 5000 个更改,并继续跟踪要跟踪的文件。谢谢你。
附上许可被拒绝的图片:
解决方案
看来您已经在用户文件夹中创建了 git 存储库。此文件夹包含许多其他进程正在使用的文件。因此,您将无法添加它们。
我认为您在错误的位置创建了存储库。
推荐阅读
- python - 如何在可视化分配期间防止 networkx_edge_labels 洗牌
- testing - 在 DRF 测试中使用 JWT 进行身份验证
- r - R:用于正态性检验的 Kolmogorov-Smirnov 检验可视化(经验 CDF 与理论 CDF 的比较)
- python - 检查使用 Selenium 每天更改的复选框的值
- python - Flask_SQLAlchemy,db.create_all() 在通过服务类导入时无法“看到”我的表
- android - 像其他流行的应用程序一样在 dallery 和其中的图像/视频中显示应用程序文件夹
- rust - 货物运行抛出openssl错误并且无法编译
- angular - 我使用 angular 11 开了一张发票,但我无法计算总金额和总金额
- python - TypeError:预期的 str、bytes 或 os.PathLike 对象,而不是 Streamlit Web 应用程序中的 PngImageFile
- php - 使用 PHP foreach 循环在许多 html div 标签中显示数据