在Windows上使用git时出现警告和致命错误? [英] Warning and fatal error when using git on windows?
问题描述
当我想获取当前状态或使用任何git命令时,我会看到以下两行错误:
When I want to get the current status or use any git command I will see these two lines of errors:
warning: unable to access 'C:/Program Files (x86)/Git': Permissio
fatal: cannot use C:/Program Files (x86)/Git as an exclude file
问题出在哪里?
预先感谢!
Where is the problem ?
Thanks in advance!
推荐答案
使用存在的排除文件
如@iltempo的注释所示-发生此错误是因为有引用读取文件C:/Program Files (x86)/Git
不是文件或不存在.
Use an exclude file that exists
As indicated by @iltempo's comment - this error occurs because there is a reference to read the file C:/Program Files (x86)/Git
which isn't a file or doesn't exist.
全局git忽略文件是一个好主意-创建一个(如果您还没有一个)-更新git使用的位置,以便使用它:
A global git ignore file is a good idea - after creating one (if you don't already have one) - update the location that git is using so that it's used:
git config --global core.excludesfile C:/Users/me/global.gitignore
或者只删除错误,删除引用:
Alternatively to just remove the error, remove the reference:
git config --global --unset core.excludesfile
这篇关于在Windows上使用git时出现警告和致命错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!