虽然自己也写了一段时间的代码了,但是我自己对于代码仓库的使用还是有些存在些问题,故写此博客,用于记录自己在使用代码仓库时所遇到的一些问题,给遇到同样问题的朋友做个参考~
![](https://i-blog.csdnimg.cn/blog_migrate/48e2ce5a56ba1643f52df5c9f000b076.jpeg)
小弟使用代码仓库不熟练,大佬轻喷。
1、使用命令git remote add upstream使得本地与远程仓库建立连接时报错,报错信息为fatal: remote upstream already exists.
问题: 问题是这样的,我已经将一个远程仓库fork到自己的本地仓库了,我在自己本地使用命令git remote add upstream remoteRepo_url
与远程仓库建立连接时报错,报错信息为fatal: remote upstream already exists。
原因:本地git已经与远程Git仓库建立连接了,所以不能够再建立与另外的Git仓库的连接。
解决方案:首先使用git remote rm upstream
删除之前的Git仓库的连接,然后使用git remote add upstream remoteRepo_ur