idea使用git上传项目到码云 pull的时候报错:The directory G:\cloudParent\micro_service is registered as a Git root...

    最近在码云自己搞了一个简单的微服务框架项目,在使用git  pull代码的时候右下角提示The directory G:\cloudParent\micro_service is registered as a Git root, but no Git repositories were found there. The directory G:\micro_service\micro_service is under Git, but is not registered in the Settings

一开始是好的,但是我把原来的本地git仓库删了,重新clone下代码导入项目,pull的时候就报错连接不到码云的git仓库,之后经过多次尝试,最终我在自己的项目中生成了一个个人公钥,使用SSH公钥来进行本地和码云仓库的连接,然后重新clone代码导入,就可以正常提交代码了,具体实施如下:

登陆码云,我的项目,点进去,如图点击管理,然后点击左侧公钥管理,

 

 添加个人公钥,这里的个人公钥的生成参考https://www.cnblogs.com/Object-Class/p/6686471.html ,生成公钥后在本地C:\Users\ASUS\.ssh路径下用记事本打开id_rsa.pub文件就是你生成的公钥,然后粘贴到码云的公钥框中就可以了。

最后我们再把代码重新拉一份就可以正常提交更新了。

猜你喜欢

转载自blog.csdn.net/qq_41189384/article/details/83549399
今日推荐