git - 如何将 git 仓库同步到镜像仓库

标签 git synchronization mirror

我想将 git 仓库镜像到我的本地仓库,并希望
及时同步它们,我是这样做的:

git clone --mirror source_url source_repo
cd source_repo
git push --mirror local_url

现在我已经将源存储库镜像到我的本地存储库,我可以克隆我的
像这样的本地 repo :
git clone local_url local_repo

但是由于源代码库正在更新,我怎么能让它们保持同步?

最佳答案

正是为此目的,我创建了 git-sync-mirror .

git-sync-mirror

A simple synchronization container image for git repositories over HTTPS

Features:

  • Authentication with https tokens
  • If needed, use a different HTTPS Proxy for source and destination
  • TLS-Trust On First Use: Seamlessly run this container behind a https scanning proxy
  • Skip certificate checks (don't do that)
  • Configure time to sleep between synchronization attempts

Usage

$ docker run \
   --rm \
   --env SRC_REPO=source \
   --env DST_REPO=destination \
   --env SLEEP_TIME=30s \
   enteee/git-sync-mirror

Note: The container is designed for synchronization over https with supported authentication using access tokens. For example replace source with https://github-user:github-access-token@github.com/Enteee/git-sync-mirror.git

关于git - 如何将 git 仓库同步到镜像仓库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48055089/

相关文章:

git - "Local refs configured for ' git push':"column mean in the output of ` git Remote show origin`是什么意思?

git - 如何为 TeamCIty 中的未决更改编写 git 日志

git - Gerrit - 如何禁止直接推送到 "master"但允许其他分支

linux - ldap修改: invalid format (line 4) entry: "olcDatabase={2},cn=config"

写入 csv 文件时的 Node.js 同步

python - 在 Python 中对角镜像

git - Jenkins 也为共享库更改运行轮询或推送触发作业

java - ExecutorService.submit(Runnable task, T result) 中的 'result' 有什么作用?

javascript - HTML Canvas : How to draw a flipped/mirrored image?

git - 为 Gerrit 及其所有 Git 存储库设置镜像的最佳方式