5. 如何把开源仓库同步到自己的gitee/github/gitlab,同时保留git log(代码提交记录)

文章目录

场景

在网上看到想学习的代码仓库A,想同步到自己使用顺手的托管平台(gitee / gitlab / github),我该怎么操作?(前提:需要同步仓库A的所有git log)

步骤
  1. download / git clone 仓库A
  2. 在托管平台(gitee / gitlab / github)新建自己的仓库B
  3. 在仓库A的根目录下打开 git bash窗口
bash 复制代码
# 查看仓库A当前关联的"远程仓库地址"
git remote -v

# 删除现有的"远程仓库地址"
git remote remove origin

# 更新"远程仓库地址"为仓库B的地址(eg. https://gitee.com/xxx/xxx.git)
git remote add origin 仓库B地址

# 推送所有代码和log到仓库B
git pull origin master --allow-unrelated-histories
git push -u origin master
  1. 进入 仓库B 的WebUI页面查看是否成功。
参考链接

https://blog.csdn.net/linzhish/article/details/126986212

https://www.cnblogs.com/Nyan-Workflow-FC/p/14454788.html

相关推荐
FIT2CLOUD飞致云1 小时前
支持Hermes Agent与MongoDB管理,1Panel v2.1.9版本发布
ai·开源·1panel
Cyeam2 小时前
Roadbook CSV:一行 CSV 秒变高德地图路书
后端·开源·aigc
一个程序猿老马4 小时前
012、远程协作:连接GitHub/Gitee与git remote
git·gitee·github
小柯博客7 小时前
STM32MP2安全启动技术深度解析
c语言·c++·stm32·嵌入式硬件·安全·开源·github
zhensherlock7 小时前
Protocol Launcher 系列:Tally 快速计数器的深度集成
前端·javascript·typescript·node.js·自动化·github·js
Hello__77777 小时前
开源鸿蒙 Flutter 实战|消息通知功能完整实现
flutter·开源·harmonyos
GoCoding7 小时前
开源好物 26/04
开源
结衣结衣.8 小时前
手把手教你实现文档搜索引擎
linux·c++·搜索引擎·开源·c++11
古城小栈8 小时前
hey 你好 “压测”
http·golang·开源
a1117769 小时前
jetpack5.0对应版本的torch和torchvision
python·开源·torch