gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 21:32:18 24 4
gpt4 key购买 nike

我想将 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com