gitlab 转移项目

git clone 旧项目url

git remote rm origin

git remote add origin 新的url

git push origin master:master --force

报错

error: src refspec master does not match any

error: failed to push some refs to xxx

查看当前分支 是否为master,如果为main,创建master分支

git checkout -b master

再提交

git push origin master:master --force

如果过程中报

fatal: 'origin' does not appear to be a git repository

fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.

请再次

git remote add origin 新的url

相关推荐
CC码码1 天前
管理你的多个 Git 密钥(多平台多账号)
git·gitlab·github
CC码码1 天前
管理你的多个 Git 密钥(单平台多账号)
git·gitlab·github
兔老大RabbitMQ1 天前
GitLab详细分析
gitlab
小道仙9714 天前
gitlab对接,gitlabRestApi,gitlab4j-api
java·git·gitlab
tswddd15 天前
项目:Gitlab HSD CI/CD总结
ci/cd·kubernetes·gitlab
许_安15 天前
docker中部署gitlab
docker·eureka·gitlab
Haoea!15 天前
持续集成 CI/CD-Jenkins持续集成GitLab项目打包docker镜像推送k8s集群并部署至rancher
ci/cd·gitlab·jenkins·rancher
xiaodaiwang15 天前
获取gitlab上项目分支版本(二)
gitlab
极小狐15 天前
GitLab CVE-2025-4278 安全漏洞解决方案
ci/cd·gitlab·devsecops·devops·gitlab升级·极狐gitlab·安全升级
weixin_4918651615 天前
git新建一个分支到gitlab项目目录中
git·gitlab