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,如下:

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

相关推荐
海天鹰13 分钟前
Catsxp:STATUS_BREAKPOINT
windows
Watermelo61731 分钟前
Vue3调度器错误解析,完美解决Unhandled error during execution of scheduler flush.
前端·javascript·vue.js·elementui·html·es6·bug
低代码布道师34 分钟前
第一部分:网页的骨架 —— HTML
前端·html
PyAIGCMaster36 分钟前
穷鬼计划:react+tailwindcss+vercel
前端·react.js·前端框架
好_快41 分钟前
Lodash源码阅读-difference
前端·javascript·源码阅读
好_快41 分钟前
Lodash源码阅读-differenceWith
前端·javascript·源码阅读
好_快1 小时前
Lodash源码阅读-differenceBy
前端·javascript·源码阅读
凌晨一点的程序员2 小时前
antd中的表格穿梭框(Transfer)如何使用
前端·javascript·html·react·antd·transfer
^小桃冰茶3 小时前
HTML 从标签到动态效果的基础
前端·html
火柴盒zhang3 小时前
基于HTML CANVAS和EXCEL的xlsx文件展示工具websheet
前端·javascript·html·spreadsheet·websheet