Git仓库迁移记录

背景:gitlab私服上面,使用 import project的方式,从旧项目迁移到新地址仓库,但是代码一直没拉过去。所以使用命令的方式,进行代码迁移。

第一步:使用git clone --mirror git地址,进行代码克隆

git clone --mirror http://xxxxxxxxxxxxx.git

第二步,进入克隆下来的git目录下,设置代码的新仓库远程地址

git remote set-url --push origin http://xxxxxxxxx.git

第三步,推送代码到远程仓库

git push --mirror http://xxxxxxxx.git

至此,代码迁移完成。

相关推荐
.Hypocritical.12 小时前
Git 入门教程
git
AI行业学习18 小时前
Claude Code + cc-switch + Git + Node.js 全套下载+安装+配置完整版
开发语言·git·python·前端框架·node.js·html·notepad++
豆角焖肉20 小时前
.gitignore:配置文件+初学入门
git·gitignore
月落归舟20 小时前
Git 新手入门指南
git
达达车20 小时前
git使用技巧记录
git·使用技巧·版本管理
Simon—欧阳1 天前
Git使用心得&理解
git
AI行业学习1 天前
Claude Code + cc-switch + Git + Node.js 一站式完整安装配置教程【8.3】
git·python·安全·前端框架·node.js·html·notepad++
AI行业学习1 天前
Claude Code + cc-switch + Git + Node.js 一站式完整安装配置教程(2026最新·国内可用版)
人工智能·git·python·安全·node.js·html·notepad++
维基框架1 天前
OpenAI在给Git做优化 上游行为要变了
人工智能·git
1名持续学习的码农1 天前
GPT Plus、GPT Pro用户第一次用Codex,项目权限和Git分支怎么设置?
人工智能·git·gpt·elasticsearch·ai编程·codex