git报错unsafe repository xxx is owned by someone else的解决办法

简介: git报错unsafe repository xxx is owned by someone else的解决办法

今天忽然发现git提交不了数据,提示如下错误。

a1.png


方法1:

修改全局配置文件,进入C:\Users\Administrator目录,记事本打开.gitconfig文件,在最后一行加上

[safe]

directory = *

如下图:

a2.png

 

方法2

通过命令给对应目录设置权限,命令行如下:

git config --global --add safe.directory F:/PageAdmin/v4.0/PageAdmin.Web

命令中的目录换成你自己的开发目录。

相关文章
|
15天前
|
存储 开发工具 git
Git日常问题: 什么是LFS?及其错误解决办法
Git LFS(Git Large File Storage)是Git的一个扩展,用于管理大型文件,通过将大文件的实际内容存储在远程服务器上,而Git仓库中只保留一个轻量级的文本指针,从而加速仓库操作的速度并减小仓库大小。当遇到Git LFS相关错误时,通常需要安装Git LFS工具并按照官方文档进行配置。
30 2
Git日常问题: 什么是LFS?及其错误解决办法
|
17天前
|
开发工具 git
【Azure App Service】App Service设置访问限制后,使用git clone代码库出现403报错
【Azure App Service】App Service设置访问限制后,使用git clone代码库出现403报错
|
30天前
|
开发工具 Android开发 git
解决Idea报错出现Git is not installed
解决Idea报错出现Git is not installed
75 2
|
30天前
|
网络安全 开发工具 数据安全/隐私保护
Git——报错总结
Git——报错总结
25 1
|
19天前
|
前端开发 JavaScript PHP
【Azure 应用服务】App Service 在使用GIt本地部署,上传代码的路径为/home/site/repository,而不是站点的根目录/home/site/wwwroot。 这个是因为什么?
【Azure 应用服务】App Service 在使用GIt本地部署,上传代码的路径为/home/site/repository,而不是站点的根目录/home/site/wwwroot。 这个是因为什么?
|
2月前
|
监控 安全 开发工具
git fatal: detected dubious ownership in repository at ‘xxx‘ 彻底解决方法
调整文件所有权和权限后,你应该能够无误地进行Git操作。持续的维护与监控文件系统的安全性能降低将来遇到类似问题的风险,并保证团队能够高效协作。如果你是在团队环境中工作,建议建立明确的协作规则和文件管理实践,以避免此类问题。
218 3
|
2月前
|
网络安全 开发工具 git
【git】解决git报错:ssh:connect to host github.com port 22: Connection timed out 亲测有效
【git】解决git报错:ssh:connect to host github.com port 22: Connection timed out 亲测有效
424 1
|
3月前
|
Shell 开发工具 git
git拉去代码报错"Failed to connect to 127.0.0.1 port 31181: Connection refused"
在克隆`https://example.git/`时遇到错误:"fatal: unable to access 'https://example.git/': Failed to connect to 127.0.0.1 port 31181: Connection refused"。原因是Windows上代理设置未正确关闭,影响了Git配置。解决方法是通过git bash运行命令检查并取消代理:`git config --global http.proxy`和`git config --global --unset http.proxy`。
71 1
 git拉去代码报错"Failed to connect to 127.0.0.1 port 31181: Connection refused"
|
2月前
|
网络安全 开发工具 git
使用git克隆仓库报错:Warning: Permanently added‘github.com’ to the .....(ssh )
所以,你可以安全地忽略这个警告,它不会影响到你使用git克隆仓库。如果你已经成功克隆了仓库,那么一切都在正常工作。如果你在克隆过程中遇到其他问题,那可能需要查看具体的错误信息来解决。
37 0
|
2月前
|
存储 开发工具 git
【Git】Git提示Another git process seems to be running in this repository, e.g. an editor opened by ..错误
【Git】Git提示Another git process seems to be running in this repository, e.g. an editor opened by ..错误
41 0