git 把项目托管到 码云出现的错误集合

分享一下我git项目时碰见的错误

1、error: could not lock config file D:/orcad/Cadence/SPB_Data/.gitconfig: No suchfile or directory

在下载git后设置用户名、邮箱时会出现的错误

需要去修改环境变量,这个之前写好了,可以跳转看看

Git配置error:could not lock config file D:/orcad/Cadence/SPB_Data/.gitconfig: No suchfile or directory_打不着的大喇叭的博客-CSDN博客https://blog.csdn.net/weixin_49931650/article/details/132416285?spm=1001.2014.3001.5501


2、error: could not lock config file D:/Git/.gitconfig: Permission denied

需要权限去修改,也在下面这篇博客中

Git配置error:could not lock config file D:/orcad/Cadence/SPB_Data/.gitconfig: No suchfile or directory_打不着的大喇叭的博客-CSDN博客https://blog.csdn.net/weixin_49931650/article/details/132416285?spm=1001.2014.3001.5501


3、Saving key "//.ssh/id_rsa" failed: No such file or directory

保存键"//.ssh/id_rsa" failed:没有这样的文件或目录

这个是 在****生成一个 SSH 密钥对时出现的,你应该看看你是否有 .ssh 文件夹,没有就手动创建一下

打开git bash,输入下面命令,生成 ssh 密钥对

javascript 复制代码
输入你的邮箱
ssh-keygen -t rsa -C "[email protected]"

注意:在上面,可能别的博客直接三个回车就行,我的不行,注意框框的内容,是这个就的在后面加上自己的路径,注意:可能你users文件夹下面不是hp,还是看看你自己的是什么


4、fatal: detected dubious ownership in repository at 'C:/Users/hp/Desktop/uniapp/u ni-shop' 'C:/Users/hp/Desktop/uniapp/uni-shop' is owned by: 'S-1-5-32-544' but the current user is: 'S-1-5-21-1168948249-367101185-590610256-1001' To add an exception for this directory, call: git config --global --add safe.directory C:/Users/hp/Desktop/uniapp/uni- shop

出现了下面这个东西,这个错误提示是由于 Git 检测到了一个具有可疑所有权的仓库,并且当前用户与该仓库的所有者不匹配

为了解决这个问题,Git 提供了添加目录例外的配置选项。你可以使用以下命令向全局 Git 配置中添加一个安全目录的例外:

javascript 复制代码
注意:不要复制我的,如果你出现上图错误,你按照他给出的填
git config --global --add safe.directory C:/Users/hp/Desktop/uniapp/uni-shop

执行上述命令,Git 将会忽略这个目录的所有权检查,使得你可以正常地进行操作和提交。


5、[email protected]: Permission denied (publickey)

复制代码
ssh -v [email protected]

ssh-agent -s

ssh-add ~/.ssh/id_rsa

eval `ssh-agent -s`

ssh-add /c/Users/hp/.ssh/id_rsa    注意:写你的实际路径

ssh -t [email protected]

照着上面敲,然后把 密匙 重新提交到码云,就可以了

6、error: remote origin already exists.

我们在上传项目时执行下面命令报的错

复制代码
git remote add origin [email protected]:gbaes/uni-shop2.git

解决方法:

1、删除现有的远程仓库: 
git remote rm origin

2、建立新的远程仓库地址: 
git remote add origin + 远程仓库地址

远程仓库地址,可以看 你码云 对应仓库的ssh,如下:

还有一些错误,当时没有记录,先这样,哭死!!!

相关推荐
EndingCoder4 小时前
React从基础入门到高级实战:React 实战项目 - 项目三:实时聊天应用
前端·react.js·架构·前端框架
阿阳微客5 小时前
Steam 搬砖项目深度拆解:从抵触到真香的转型之路
前端·笔记·学习·游戏
德育处主任Pro5 小时前
『React』Fragment的用法及简写形式
前端·javascript·react.js
CodeBlossom6 小时前
javaweb -html -CSS
前端·javascript·html
打小就很皮...6 小时前
HBuilder 发行Android(apk包)全流程指南
前端·javascript·微信小程序
集成显卡7 小时前
PlayWright | 初识微软出品的 WEB 应用自动化测试框架
前端·chrome·测试工具·microsoft·自动化·edge浏览器
前端小趴菜058 小时前
React - 组件通信
前端·react.js·前端框架
Amy_cx8 小时前
在表单输入框按回车页面刷新的问题
前端·elementui
dancing9998 小时前
cocos3.X的oops框架oops-plugin-excel-to-json改进兼容多表单导出功能
前端·javascript·typescript·游戏程序
后海 0_o9 小时前
2025前端微服务 - 无界 的实战应用
前端·微服务·架构