Git error-fatal-Needed a single revision
由于公司要求,需要把旧的项目迁移到新的gitlab地址上,这好办,只需要改下remote repository url就可以了,如果仓库中用到子模块,还需要顺便更新子模块的url。
不过,本地是编译通过了,但是推送到远程后,gitlab CI编译时会报错如下:
fatal: Needed a single revision
Unable to find current origin/HEAD revision in submodule path
网上也能搜到相同的问题,但是没有一个是在gitlab CI上遇到这个问题的,他们的解决方法存在一些问题,在gitlab CI上仍然会报相同的错误。
后面经过几天的摸索,终于找到正确的解决方法。
- 移除子模块
git rm <submodulePath>
注意需要使用git rm命令来删除子模块,这样.gitmodules下的相关信息也能一并删除。
- 提交删除更改
git commit -m "remove submodule"
- 重新添加子模块
git submodule add <url> <path>
- 提交添加子模块更改
git commit -m "add submodule"
这时候再看gitlab CI,就不会再报这个错误了。
Git error-fatal-Needed a single revision相关推荐
- fatal: Needed a single revision, invalid upstream “xxxx“ 问题解决
在日常使用 git 的时候,使用 git rebase 或者其他 git 命令操作分支的时候可能会遇到如下问题: 使用命令: git rebase branch_name 得到错误: fatal: N ...
- fatal: Needed a single revision和Unable to find current revision in submodule path解决办法
当执行 git submodule update 遇见问题 fatal: Needed a single revision Unable to find current revision in sub ...
- 解决 fatal: unable to access ‘https://github.com/qweertu/git-demo.git/‘: error setting certificate...
git push 时出现错误 fatal: unable to access 'https://github.com/qweertu/git-demo.git/': error setting ce ...
- 关于git的fatal: unable to access ‘https://gitee.com/‘: Could not resolve host: gitee.com; Unknown error
关于GIT 的 fatal: unable to access 'https://gitee.com/项目名称/ceshi.git/': Could not resolve host: gitee.c ...
- git pull fatal: refusing to merge unrelated histories
1.首先我github有个远程仓库,然后我本地有个仓库 本地仓库我新添加了一个文件,然后我去关联(git remote add origin git@github.com:qshilary/gitte ...
- npm ERR! code 128npm ERR! An unknown git error occurrednpm ERR! command git --no-replace-objects l
背景: 在安装vue-element-admin 项目所需依赖时,出现了如下报错信息 npm ERR! code 128 npm ERR! An unknown git error occurred ...
- 【git】fatal: in unpopulated submodule
为了直接编译go代码,把依赖库放common下了. 然后, 把下载回来的git 代码上传了 怎么才能 直接上传代码呢? 直接add报错:fatal: in unpopulated submodule ...
- Error:The SDK Build Tools revision (23.0.3) is too low for project ':app'. Minimum required is 25.0.
导入github上项目的时候出现 Error:The SDK Build Tools revision (23.0.3) is too low for project ':app'. Minimum ...
- git错误fatal: remote origin already exists.
输入 $git remote add origin https://github.com/用户名/项目.git,提示fatal: remote origin already exists. 解决办法 ...
最新文章
- 6.MATLAB变量——矩阵操作一
- [学习笔记]树链剖分
- JavaScript中带示例的String repeat()方法
- 依赖注入(Dependency Injection)框架是如何实现的?
- 高斯09linux教程,Gaussian 09的安装与使用
- 1024,错过这一波福利,又要等一年了!
- Python调用pywin32模拟触屏滑动 刷宝视频,自动刷视频python
- 解Invalid character found in the request target.
- 语音短时过零率计算——Python实现
- cobol .cpy文件_Visual COBOL R3:“使传统的COBOL能够部署在JVM或.NET上”。
- Java Netty长连接实现Android推送
- Windows下Idea,AndroidStudio的字体美化
- 关于Python 统计出log文件 各个类型的大小总和
- python做性能测试框架_python常用web框架简单性能测试结果分享(包含dja
- ToDesk安装与使用
- 区别 |Python的 open() 和with open() as
- 洛谷—P1417 烹调方案(背包问题)
- HTML 鼠标点击复制元素内容
- 电脑充电和电池保养的标准答案
- 面对质疑,统一操作系统UOS竟然这样回应!