gitlab代码恢复

gitlab代码恢复

背景:
从gitlab的web端页面下载了代码。需要恢复到新的gitlab上。下面操作以vonebaas-c-fabric-explorer-front工程为例
已经下载好vonebaas-c-fabric-explorer-front工程的zip包:

操作步骤

原来的git地址是:http://xxx.git.com:9002/
新的git地址是:http://119.45.132.177/

1. 在新git上添加一个空的vonebaas-c-fabric-explorer-front工程

可以看到新建的vonebaas-c-fabric-explorer-front工程下面没用任何内容,只有使用提示:

2. 在git客户端,将新建的vonebaas-c-fabric-explorer-front工程clone下来

比如我的git客户端在一台linux机器(119.45.132.177)上:

root@VM-0-4-ubuntu:~# git clone http://119.45.132.177/baas/vonebaas-c-fabric-explorer-front.git
Cloning into 'vonebaas-c-fabric-explorer-front'...
Username for 'http://119.45.132.177': root
Password for 'http://root@119.45.132.177': 
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
Unpacking objects: 100% (3/3), 2.80 KiB | 2.80 MiB/s, done.

3. 检查下clone下来的仓库

cd vonebaas-c-fabric-explorer-front 
ls -alt

4. 将备份的压缩包上传到服务器解压

解压:

unzip vonebaas-c-fabric-explorer-front-master-4092a20d6.zip
cd vonebaas-c-fabric-explorer-front-master-4092a20d6e38d66fc1e8b1cab52409c9613abb03
ls -alt

5. 将数据拷贝到新建的仓库中

cp -rf vonebaas-c-fabric-explorer-front-master-4092a20d6e38d66fc1e8b1cab52409c9613abb03/* vonebaas-c-fabric-explorer-front/ 
ls vonebaas-c-fabric-explorer-front

6. 将新vonebaas-c-fabric-explorer-front提交到新仓库

git add .
git commit -m "add"
git push


7. 打开新git,检查恢复情况

posted @   邹姣姣  阅读(42)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· winform 绘制太阳,地球,月球 运作规律
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 上周热点回顾(3.3-3.9)
· AI 智能体引爆开源社区「GitHub 热点速览」
点击右上角即可分享
微信分享提示