gitlab ci里push代码错误

在.gitlab-ci.yml文件里直接写命令提交代码,会报错,就算前面使用了git remote origin添加了新的远程地址,还是会报错,报错信息下图所示:

搜索了一大圈,最后在gitlab官网找到了例子。

示例代码链接:.gitlab-ci.yml · master · Guided Explorations / .gitlab-ci.yml Tips, Tricks and Hacks / Commit Back To Repos During Pipeline / Commit To Self and Project Wiki and External Repos During Pipeline · GitLab

 关键点是push的时候指定远程仓库和分支,如图:

git push --tags http://root:$ACCESS_TOKEN@$CI_SERVER_HOST/$CI_PROJECT_PATH.git HEAD:master

猜你喜欢

转载自blog.csdn.net/u012787757/article/details/121384392