文章目录
- 一、拉代码报错The project you were looking for could not be found
- 问题描述:
- 原因分析:
- 解决方案:
- 1、一次性
- 2、永久性
- 二、提交报错committing is not possible because you have unmerged files.
- 问题描述:
- 原因分析:
- 解决方案:
- 三、项目推送时遇Git推送错误
- 问题描述:
- 原因分析:
- 解决方案:
- 四、项目提交时遇Git错误
- 问题描述:
- 原因分析:
- 解决方案:
- 五、正常流程:
- 1、克隆代码
- 2、编辑项目
- 3、提交代码
- 4、拉取代码
- 5、解决冲突
- 6、推送代码
- 六、常用命令:
一、拉代码报错The project you were looking for could not be found
问题描述:
使用git从远程仓库克隆项目到本地的时候。
(图片来源网络,侵删)git clone http://gitlab.com/project/xxxx.git
出现这个问题:The project you were looking for could not be found.
原因分析:
-
你的账号没有项目的权限,你可以在浏览器输入你的项目地址,如果可以进入,则说明有权限;若不能进入,说明你没有该项目的权限。
(图片来源网络,侵删) -
你电脑的git自动保存了其他的用户名密码信息,与当前项目的用户名密码与之前的发生冲突。
解决方案:
1、一次性
克隆的时候远程地址带上用户名及密码即可解决
git clone http://username:password@gitlab.com/project/xxxx.git
2、永久性
清除本地git账户,重新输入用户名与密码。之后再进行git操作时,弹出用户名密码窗口,输入即可。
git config --system --unset credential.helper
mac:
git config --global --unset credential.helper
二、提交报错committing is not possible because you have unmerged files.
问题描述:
Committing is not possible because you have unmerged files.
原因分析:
由于您没有合并的文件,因此无法提交。
解决方案:
用git diff或者git status 查看哪些文件冲突,有冲突的会提示:
++
-