Cómo hacer un espejo GitHub a Bitbucket?
Tengo un repositorio que he clonado de GitHub y quiero tener un espejo de este repositorio en BitBucket. ¿Hay alguna manera de hacerlo? Algo así como tener dos orígenes en el repo como creo.
4 answers
Simplemente podría agregar un segundo control remoto:
git remote add bitbucket /url/to/am/empty/bitbucket/repo
Y empujar todo a bitbucket:
git push --mirror bitbucket
En realidad puede extraer o empujar a múltiples controles remotos desde su repositorio local.
Como se indica a continuación en Rahulmohan Kolakandy 's respuesta , si está hablando de un servidor BitBucket en las instalaciones (en lugar de bitbucket.org), entonces usted puede tomar ventaja de BitBucket Server Smart Mirroring.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-11-09 15:51:44
El método explicado aquí es mejor https://stackoverflow.com/a/12795747/988941
git remote set-url origin --add https://bitbucket.org/YOU/YOUR_REPO.git
La versión reciente de git maneja múltiples URLs en el mismo origen;)
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-05-23 12:34:15
Ya no tiene que crear estos enlaces espejo. Bitbucket ha creado este concepto de espejo inteligente que hace una sincronización en tiempo real con su servidor mirror.
Más información aquí https://confluence.atlassian.com/bitbucketserver/smart-mirroring-776640046.html
Espero que esto ayude!
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-11-09 15:44:24
También puede comprobar lo siguiente (copiar pegado desde los enlaces de abajo);
Desde Cómo reflejar correctamente un repositorio git , puede usar
git clone --mirror [email protected]/upstream-repository.git
cd upstream-repository.git
git push --mirror [email protected]/new-location.git
O puedes seguir Duplicando un repositorio ;
Abra Terminal y cree un clon desnudo del repositorio.
git clone --bare https://github.com/exampleuser/old-repository.git
Mirror-push al nuevo repositorio.
cd old-repository.git
git push --mirror https://github.com/exampleuser/new-repository.git
Elimine el repositorio local temporal que creó en el paso 1.
cd ..
rm -rf old-repository.git
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-01-31 13:20:21