04.Gitea迁移与同步

清夏晚风

迁移与同步

GitHub -> Gitea

1
2
3
4
5
6
7
# 使用迁移工具
docker run -it --rm \
-v /path/to/config:/config \
gitea/migrate:v3 \
--github-token your_github_token \
--gitea-url http://your-gitea.com \
--gitea-token your_gitea_token

双向同步配置

1
2
3
4
5
6
7
8
9
10
# .gitea/sync.yml
repos:
- source: github.com/yourorg/repo
target: gitea.com/yourorg/repo
triggers:
- event: push
branches: [main, develop]
webhooks:
- type: slack
url: https://hooks.slack.com/services/...

数据备份

1
2
3
4
5
# 全量备份
gitea dump -c /etc/gitea/app.ini --tempdir /tmp

# 增量备份(使用Restic)
restic -r s3:s3.amazonaws.com/your-bucket backup /var/lib/gitea

参考文档:Gitea官方迁移指南

  • Title: 04.Gitea迁移与同步
  • Author: 清夏晚风
  • Created at : 2026-01-13 16:48:23
  • Updated at : 2026-01-13 16:48:23
  • Link: https://blog.kimikkorow.eu.org/版本控制管理/Gitea/04.Gitea迁移与同步/
  • License: This work is licensed under CC BY-NC-SA 4.0.