将Gitlab或Github存储库镜像到自托管的Gitea服务器

huangapple go评论63阅读模式
英文:

Mirroring a Gitlab or Github repo to a selfhosted Gitea server

问题

以下是翻译好的内容:

"Good day all.

I am trying to mirror Git repositories, in full, for various OpenSource Projects that I am forking for my clients, in order to customizations.

These are the steps I am following:

$ git clone --mirror https://github.com/pathto/project.git
$ cd project.git
$ git remote set-url --push origin git@git.localserver.net:pathto/project
$ git push --mirror

And that last step I get a ! [remote rejected] on everything. (pre-receive hook declined)

I have setup the repository on Gitea and I have a SSH key installed. Everything uploads but then errors spits out for everything after the upload is complete.

My final step is to have a daily cron that does a fetch from github/gitlab and then a push to the local server."

英文:

Good day all.

I am trying to mirror Git repositories, in full, for various OpenSource Projects that I am forking for my clients, in order to customizations.

These are the steps I am following:

$ git clone --mirror https://github.com/pathto/project.git
$ cd project.git
$ git remote set-url --push origin git@git.localserver.net:pathto/project
$ git push --mirror

And that last step I get a ! [remote rejected] on everything. (pre-receive hook declined)

I have setup the repository on Gitea and I have a SSH key installed. Everything uploads but then errors spits out for everything after the upload is complete.

My final step is to have a daily cron that does a fetch from github/gitlab and then a push to the local server.

答案1

得分: 2

我通过阅读 Gitea 手册弄清楚了。

Gitea 具有内置的仓库镜像功能,支持推送和拉取两个方向。在组织内,不需要创建仓库,只需创建一个迁移并按照向导操作即可。

它会为您完成一切。

英文:

I figured it out by Reading the Gitea manual.

Gitea has built-in repository mirroring, in both the push and the pull directions. Inside the organization, instead of creating a repository, create a migration and just follow the wizard.

It does everything for you.

huangapple
  • 本文由 发表于 2023年6月19日 17:45:30
  • 转载请务必保留本文链接:https://go.coder-hub.com/76505437.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定