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

相关推荐
GoGeekBaird9 小时前
我开源了 BeeWeave,给 AI Agent 搭一个越用越懂你的知识创作台
后端·github
fthux10 小时前
GitZip Pro 源码解析:一个 GitHub 文件/文件夹下载扩展是如何工作的(一)整体架构与扩展入口
人工智能·ai·开源·github·open source
第一程序员11 小时前
Rust Agent 子进程执行:Command 之前,先定义输入和超时
python·rust·github
修己xj11 小时前
让README “活”起来:Readme Typing SVG 介绍与本地化改造实践
开源
2501_9369603613 小时前
GitHub初步了解
github
wangruofeng14 小时前
11 万 Star 的生成式 AI 入门课,Microsoft 做对了什么
github·aigc·ai编程
ApacheSeaTunnel14 小时前
为什么 Data Ingestion 还没有被 Fivetran/Airbyte 完全解决?
大数据·开源·数据集成·seatunnel·技术分享·数据同步·airbyte·fivetran
IOT那些事儿14 小时前
GitHub Profile 429: Too Many Requests
github·profile·429
峰向AI14 小时前
Agent 看不了视频?这个 7K Star 的开源插件一招搞定
github
程序员吕洞宾14 小时前
开源多维表格SmartTable V1.6:自动化工作流,把重复操作交给系统即可
开源·自动化·github·多维表格·飞书多维表