From c8a35128efd26c23a081d9c98371b621698d6f7e Mon Sep 17 00:00:00 2001 From: thigg Date: Mon, 24 Jul 2023 15:57:36 +0200 Subject: [PATCH 1/2] added ssh mirror workaround description related #1635 #18159 --- docs/content/doc/usage/repo-mirror.en-us.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/content/doc/usage/repo-mirror.en-us.md b/docs/content/doc/usage/repo-mirror.en-us.md index 5e2b5c3238745..6b49a478994df 100644 --- a/docs/content/doc/usage/repo-mirror.en-us.md +++ b/docs/content/doc/usage/repo-mirror.en-us.md @@ -92,3 +92,14 @@ To set up a mirror from Gitea to Bitbucket, you need to follow these steps: 4. Select **Add Push Mirror** to save the configuration. The repository pushes shortly thereafter. To force a push, select the **Synchronize Now** button. + +### Mirror an existing ssh repository +Currently gitea supports no ssh push mirrors. You can work around this by adding a `post-receive` hook to your gitea repository that pushes manually. + +1. Make sure the user running gitea has access to the git repo you are trying to mirror to from shell. +2. On the Webinterface at the repository settings > git hooks add a post-receive hook for the mirror. I.e. +``` +#!/usr/bin/env bash +git push --mirror --quiet git@github.com:username/repository.git &>/dev/null & +echo "GitHub mirror initiated .." +``` From 513ce494981474f5f64bcc8f9b896d8bf4a306e8 Mon Sep 17 00:00:00 2001 From: thigg Date: Tue, 25 Jul 2023 16:48:34 +0200 Subject: [PATCH 2/2] fixed linting errors --- docs/content/doc/usage/repo-mirror.en-us.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/content/doc/usage/repo-mirror.en-us.md b/docs/content/doc/usage/repo-mirror.en-us.md index 6b49a478994df..157b6c124e5d0 100644 --- a/docs/content/doc/usage/repo-mirror.en-us.md +++ b/docs/content/doc/usage/repo-mirror.en-us.md @@ -94,10 +94,12 @@ To set up a mirror from Gitea to Bitbucket, you need to follow these steps: The repository pushes shortly thereafter. To force a push, select the **Synchronize Now** button. ### Mirror an existing ssh repository + Currently gitea supports no ssh push mirrors. You can work around this by adding a `post-receive` hook to your gitea repository that pushes manually. 1. Make sure the user running gitea has access to the git repo you are trying to mirror to from shell. 2. On the Webinterface at the repository settings > git hooks add a post-receive hook for the mirror. I.e. + ``` #!/usr/bin/env bash git push --mirror --quiet git@github.com:username/repository.git &>/dev/null &