报错The project you were looking for could not be found 解决方式"/>
git报错The project you were looking for could not be found 解决方式
问题描述:
使用git从远程仓库克隆项目到本地的时候。
git clone .git
出现这个问题:The project you were looking for could not be found.
原因分析:
-
你的账号没有项目的权限,你可以在浏览器输入你的项目地址,如果可以进入,则说明有权限;若不能进入,说明你没有该项目的权限。
-
你电脑的git自动保存了其他的用户名密码信息,与当前项目的用户名密码与之前的发生冲突。
解决方案:
1、一次性
克隆的时候远程地址带上用户名及密码即可解决
git clone http://username:password@gitlab/project/xxxx.git
2、永久性
清除本地git账户,重新输入用户名与密码。之后再进行git操作时,弹出用户名密码窗口,输入即可。
windows:
git config --system --unset credential.helper
mac:
git config --global --unset credential.helper
常用命令:
初始化仓库:git init
克隆项目:git clone
添加文件到暂存区:git add
添加当前目录中的所有文件:git add .
提交到本地仓库:git commit -m “”
推送到远程仓库:git push origin
拉取远程仓库所有分支合并到本地:git pull
创建分支:git branch
查看分支:git branch
切换分支:git checkout
删除分支:git branch -d
合并分支:git merge
查看存储库的状态:git status
显示提交历史:git log
更多推荐
git报错The project you were looking for could not be found 解决方式
发布评论