英文:
GIT - Errors when executing git init
问题
在使用GitBash在Windows虚拟机中执行git init
时,一个开发者遇到了以下错误:
-
第一次出现
错误:无法写入配置文件//xxx/yyy/.git/config:功能未实现 致命错误:无法将'core.symlinks'设置为false
-
第二次出现
错误:无法写入配置文件//xxx/yyy/.git/config:功能未实现 致命错误:无法将'core.repositoryformatversion'设置为'0'
然而,另一个在同一虚拟机中的开发者没有遇到问题。
他能够执行git init
、git add
、git commit
和git push
。
如果您遇到了相同的问题并找到了解决方案,请提供帮助。
英文:
When executing git init
in GitBash, in a Windows VM, one developer had the following errors:
-
1st instance
error: could not write config file //xxx/yyy/.git/config: Function not implemented Fatal: could not set 'core.symlinks' to false
-
2nd instance
error: could not write config file //xxx/yyy/.git/config: Function not implemented Fatal: could not set 'core.repositoryformatversion' to '0'
However, another developer in the same VM had no issues.
He is able to execute git init
, git add
, git commit
& git push
.
Please help if you had the same issues and discovered the solution.
答案1
得分: 1
这通常是由权限错误引起的。
因此,一个开发者能够使用git,而另一个开发者不能。
请检查您的文件夹(git存储库文件夹)的权限,并验证指定的用户是否能够向该文件夹写入内容(检查指定文件夹及其父文件夹的权限)。
另一个可能性(但不太可能)是防病毒软件正在阻止您更改该文件夹。
英文:
This is usually caused by permission error.
And thus it makes sense that one developer is able to use git while the other one isn't.
Check your folder (git repository folder) permissions and verify that the given user is able to write content to this folder. (check the permissions on the given folder and its parent)
Another option (might be but less likely) is that the antivirus is blocking you from changing the folder
答案2
得分: 0
当在文件夹中创建存储库时:git会在目录的基础处创建一个.git/
文件夹,然后操作该文件夹中的文件。
- 检查是否确实创建了这个文件夹(例如在Shell中键入
dir //xxx/yyy/.git
), - 检查该
.git/
文件夹的访问权限(在属性窗口的“安全”选项卡中)。
英文:
(to add to @CodeWizard's answer)
When creating a repo in a folder : git creates a .git/
folder at the base of the directory, and then manipulates files in this folder.
- Check if this folder is indeed created (type
dir //xxx/yyy/.git
in a shell for example), - check the access permissions ("Security" tab of the Properties window) on this
.git/
folder.
答案3
得分: 0
当禁用了虚拟机的趋势科技(Trend Micro)时,错误消失了。我不确定为什么在启用趋势科技时,某些文件夹没有出现错误。所以可能需要以不同方式配置趋势科技。
英文:
When Trend Micro was disabled for the VM, the error disappeared. I am not sure why some folders did not have the error when Trend Micro was enabled. So probably Trend Micro had to be configured differently.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论