git clone 报 “remote: The project you were looking for could not be found.”
程序员文章站
2022-04-28 12:51:39
...
问题:
自己的项目不止一个,帐号也不同,在clone的时候都又自动保存git的账户和密码功能,然而当clone 第二个项目的时候就会报一下错误
$ git clone https://gitlab.com/abc/abc-abc-xxx.git
Cloning into 'abc-abc-xxx'...
remote: The project you were looking for could not be found.
fatal: repository 'https://gitlab.com/abc/abc-abc-xxx.git/' not found
解决方法:
之前试了几种方案,比如把以前的帐号删除,这样比较麻烦等,都没有特别好的效果。
经过同事的交流与网上查看,发现了一个新的解决方法。
在项目前面添加用户名
git clone https://gitlab.com/abc/abc-abc-xxx.git
git clone https://[email protected]/abc/abc-abc-xxx.git
xxxx 即是用户名
$ git clone https://[email protected]/abc/abc-abc-xxx.git
Cloning into 'abc-abc-xxx'...
Password for 'https://[email protected]':
remote: Enumerating objects: 5733, done.
remote: Counting objects: 100% (5733/5733), done.
remote: Compressing objects: 100% (3238/3238), done.
remote: Total 5733 (delta 2437), reused 5466 (delta 2194)
Receiving objects: 100% (5733/5733), 124.74 MiB | 449.00 KiB/s, done.
Resolving deltas: 100% (2437/2437), done.
Checking out files: 100% (2617/2617), done.
至此,代码clone完毕