svnadmin 在 git 中转储

发布于 2024-08-22 04:11:39 字数 228 浏览 2 评论 0原文

我正在将我的大量工作从个人 SVN 存储库转移到 git 存储库。我有一个 cron 作业设置,每天晚上在我的所有存储库上运行 svnadmin dump 到远程文件夹中。 git中有类似的功能吗?

另外,我不完全理解 git,所以这个逻辑很可能是错误的,但是我将所有 svn 存储库保存在一个目录(/home/svn/)下,git 是否创建了一个类似的目录,我可以将其复制到位置偏远?或者它只将快照存储在 .git 目录中?

I'm in the process of moving a bunch of my work from personal SVN repo's to git repo's. I've had a cron job setup that runs svnadmin dump every night on all my repos into a remote folder. Is there similar functionality in git?

Also, I don't fully understand git, so this logic is most likely wrong, but I kept all my svn repos under a single directory (/home/svn/), does git create a similar directory that I can just copy to a remote location? Or does it only store the snapshots in the .git directory?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

你的往事 2024-08-29 04:11:39

您可以使用 git 克隆。请注意,git 没有等同于 svnadmin 的功能,因为每个 git“工作副本”(使用 SVN 术语)都是一个完整的存储库。

You can just use git clone. Note that git has no equivalent to svnadmin, as every git "working copy" (to use SVN terms) is a full repository.

扭转时空 2024-08-29 04:11:39
#!/bin/bash
# tar.bz2 to the stdout the git repo from the current dir.
TMP=`mktemp -d`
trap "rm -rf $TMP" EXIT
git clone --template=. --mirror . "$TMP" && tar -cjC "$TMP" .

ps:并非每个 git“工作副本”都是完整的存储库。
其中大多数是,但下面示例创建的不是。

git clone --depth 4 . `mktemp -d`
#!/bin/bash
# tar.bz2 to the stdout the git repo from the current dir.
TMP=`mktemp -d`
trap "rm -rf $TMP" EXIT
git clone --template=. --mirror . "$TMP" && tar -cjC "$TMP" .

ps: Not every git "working copy" is the full repository.
Most of them are, however the one created by the example below is not.

git clone --depth 4 . `mktemp -d`
谎言 2024-08-29 04:11:39

无法(内置于 git)将多个存储库复制/镜像到远程计算机。您的新 cron 作业必须单独克隆/推送每个存储库,您可以使用另一种方法来同步所有存储库。存储库只是普通文件,因此如果将它们全部保存在 /srv/svn 或类似文件中,您可以简单地将该目录rsync 到另一台计算机。

在更新存储库的同时使用 rsync 可能会出现问题,但如果这是供个人使用,您几乎可以保证存储库在夜间左右处于“空闲”状态。

There is no way (built in to git) to copy/mirror multiple repositories to a remote computer. Either your new cron job will have to clone/push each repository individually, you you could use another way to sync all the repositories. The repositories are just ordinary files, so if you keep them all in /srv/svn or similar, you could simply rsync that directory to another computer.

There might be issues with using rsync at the same time the repositories are being updated, but if this is for personal use you can probably pretty much guarantee that the repositories are "idle" during the night time or so.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文