朝阳博客

  • Article
  • Project
  • HTML+CSS
  • Bootstrap
  • JavaScript
  • jQuery
  • PHP
  • Java
  • Linux
  • MySQL
朝阳博客
一款专注于博客的响应式网站
  1. 首页
  2. Article
  3. 正文

如何将当前项目git提交到gitee github gitea多个平台上 并且保留commit提交日志

2025年6月26日 18点热度 0人点赞 0条评论

先创建仓库

  • gitee:https://gitee.com/zhaoyangweb/gitee.git
  • github: https://github.com/aiyaodada/github.git
  • gitea: https://git.zhaoyangweb.com/aiyao/gitea.git

先给当前仓库绑定到这三个地址

git remote add gitee https://gitee.com/zhaoyangweb/gitee.git
git remote add github https://github.com/aiyaodada/github.git
git remote add gitea https://git.zhaoyangweb.com/aiyao/gitea.git

查询下绑定成功没

git remote -v

修改nginx配置文件 如果没有反向代理gitea的话 则不需要修改

server模块 或者更大

client_max_body_size 1024M;

强制提交到未同步的里面

  • 例如gitee为主仓库 github 和 gitea没同步
  • 推荐同时为main或者master
    git push -f github master
    git push -f gitea master
  • 如果master 为main的话 则修改成
    git push -f github main
    git push -f gitea main

提交后则可以删除添加的仓库了

git remote remove gitee
git remote remove github
git remote remove gitea

懒人办法

git remote add origin https://gitee.com/zhaoyangweb/gitee.git
git remote set-url --add origin https://github.com/aiyaodada/github.git
git remote set-url --add origin https://git.zhaoyangweb.com/aiyao/gitea.git

提交时

git push origin master

拉取所有

git pull --all

以上就携带了commit历史记录提交到新仓库了 如果不行看下面

commit提交

先拉取所有信息

git clone --mirror https://gitee.com/zhaoyangweb/gitee.git

查看所有分支的提交历史

git log --all --oneline

查看所有分支 (本地和远程跟踪)

git branch -a

查看所有标签

git tag -l

修改本地仓库的远程 URL 例如转到github

git remote set-url origin https://github.com/aiyaodada/github.git

推送

git push --mirror origin

项目比较大的话

增加 Git 缓冲区大小

git config --global http.postBuffer 524288000

启用 Git 长路径支持(Windows 特有)

git config --global core.longpaths true

有问题联系微信:C2655906529或者QQ:2655906529

标签: 暂无
最后更新:2025年6月27日

aiyao

你要加油,你喜欢的人还没结婚。

点赞
< 上一篇

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

COPYRIGHT © 2021 zhaoyangweb.com. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

冀ICP备2021020018号-1