在下载源码的过程中,有些在gitlab上,有写在github上。
本地电脑也有点问题:
git clone git@gitlab.com:kinco/source_code.git ,就可以正常下载,而加上sudo,变成
sudo git clone git@gitlab.com:kinco/source_code.git ,后就会出现错误
Cloning into 'source_code'...
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.其实key已经加入进去了。
而使用git clone https://github.com/ros-planning/navigation.git,不加sudo,就会有以下错误
Failed to connect to localhost port 48239: Connection refused
加上sudo后,代码可以正常下载,但权限需要重新修改,都是root.root,改成用户权限

本文探讨了在使用Git从GitLab和GitHub克隆源码过程中遇到的权限问题。当使用SSH方式克隆时,不加sudo命令能正常工作,而加上sudo则会报错;使用HTTPS方式时情况相反,需要使用sudo才能成功克隆。
1297

被折叠的 条评论
为什么被折叠?



