From 5992365fc1e6cecb0c76c8eb2b5897a291355f61 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Tue, 25 Jul 2023 12:32:39 -0400 Subject: [PATCH] added ssh mirror workaround description (#26096) (#26136) Backport #26096 by @thigg related #1635 #18159 This will probably be obsolete at some point, but it should not break anything and it may help some users Co-authored-by: thigg --- docs/content/doc/usage/repo-mirror.en-us.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/content/doc/usage/repo-mirror.en-us.md b/docs/content/doc/usage/repo-mirror.en-us.md index 5e2b5c3238..157b6c124e 100644 --- a/docs/content/doc/usage/repo-mirror.en-us.md +++ b/docs/content/doc/usage/repo-mirror.en-us.md @@ -92,3 +92,16 @@ 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 .." +```