Ubuntu/Windows —— Git:: git仓库迁移到另一个集群服务器2

本文详细介绍如何将GitHub上的仓库迁移到GitLab,包括使用Personal Access Token进行身份验证,从GitLab.com导出并导入仓库至自建GitLab服务器的过程,以及如何更改本地项目的远程仓库地址。

原博地址:https://www.cnblogs.com/saysmy/p/10942814.html
**

此处转载,仅为记录以备后续自己查看!

**

一. github仓库迁移到gitlab

先进入 new project:
在这里插入图片描述
择 Import project, 选择下面的github:

在这里插入图片描述
进入后,这里需要github的 personal access token, 点击下图跳到github的token页面获取token:
选择新建一个token:
在这里插入图片描述

填写一段token的描述信息,勾选第一个 repo:
在这里插入图片描述

创建后,复制token,保存好,因为之后你就再也看不到这个token啦,只有token的描述名字:
在这里插入图片描述

复制上面的token填写到gitlab,然后查看可用的列表:
在这里插入图片描述

选择要导入的gitlab仓库,点击Import:
在这里插入图片描述

成功导入:
在这里插入图片描述

如果出现以下错误:

在这里插入图片描述
检查导入的gitlab仓库是否是私有的,需要改成public才可以:
在这里插入图片描述

二. gitlab服务器之间的迁移

从一个gitlab服务器迁移到另一个,比如从gitlab.com迁移到自己的gitlab服务器。
如下图,先在gitlab.com 导出对应仓库的代码(包含了所有的分支和历史记录、标签等),gitlab会发一份下载链接到你的邮箱,只需要点击下下载即可。
在这里插入图片描述

成功发送下载链接到邮箱:
在这里插入图片描述

邮件内容如下:
在这里插入图片描述

下载好后,即可到自己的gitlab服务器网站,创建新项目:
在这里插入图片描述

选择第一个从gitlab的导出包中导入的方式:
在这里插入图片描述
填写仓库信息,上传刚才邮件下载的仓库包:
在这里插入图片描述

等待导入:
在这里插入图片描述
导入成功:
在这里插入图片描述

三. 更改远程仓库地址
迁移后可能需要更改本地的远程仓库地址:

更改远程仓库地址:

git remote set-url origin 仓库地址

例如:

git remote set-url origin git@gitlab.xxx.com:frontend/scaffold/gulp.git 

更改完毕验证:

git remote -v

**

注:本文为转载,原博文地址为:https://www.cnblogs.com/saysmy/p/10942814.html
此处转载,仅为记录以备后续自己查看!**

# 添加官方源(如前所述) curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | \ sudo gpg --dearmor -o /usr/share/keyrings/postgresql-archive-keyring.gpg echo "deb [signed-by=/usr/share/keyrings/postgresql-archive-keyirng.gpg] http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" | \ sudo tee /etc/apt/sources.list.d/pgdg.list sudo apt update sudo apt install -y postgresql-16 deb [signed-by=/usr/share/keyrings/postgresql-archive-keyirng.gpg] http://apt.postgresql.org/pub/repos/apt focal-pgdg main Hit:1 http://mirrors.tencentyun.com/ubuntu focal InRelease Hit:2 http://mirrors.tencentyun.com/ubuntu focal-updates InRelease Hit:3 http://mirrors.tencentyun.com/ubuntu focal-backports InRelease Hit:4 http://mirrors.tencentyun.com/ubuntu focal-security InRelease Hit:5 https://download.docker.com/linux/ubuntu focal InRelease Hit:6 http://ppa.launchpad.net/git-core/ppa/ubuntu focal InRelease Hit:7 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/8.0 InRelease Ign:8 http://apt.postgresql.org/pub/repos/apt focal-pgdg InRelease Err:9 http://apt.postgresql.org/pub/repos/apt focal-pgdg Release 404 Not Found [IP: 198.18.0.12 80] Hit:10 https://packages.redis.io/deb focal InRelease Reading package lists... Done E: The repository 'http://apt.postgresql.org/pub/repos/apt focal-pgdg Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package postgresql-16
最新发布
11-13
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值