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 把项目托管到 码云出现的错误集合_第1张图片

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

输入你的邮箱
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 配置中添加一个安全目录的例外:

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

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

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

git 把项目托管到 码云出现的错误集合_第2张图片

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

你可能感兴趣的:(前端开发错误聚集,Git,git,github,windows,vim,gitlab,前端)