git报错The project you were looking for could not be found 解决方式

编程入门 行业动态 更新时间:2024-10-27 05:21:52

git<a href=https://www.elefans.com/category/jswz/34/1771188.html style=报错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.

原因分析:

  1. 你的账号没有项目的权限,你可以在浏览器输入你的项目地址,如果可以进入,则说明有权限;若不能进入,说明你没有该项目的权限。

  2. 你电脑的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 解决方式

本文发布于:2023-12-06 14:36:08,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1667881.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:报错   方式   git   project

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!