简体   繁体   English

GIT等效于“ svnrdump dump –incremental”

[英]GIT equivalent to “svnrdump dump --incremental”

Is there an equivalent to "svnrdump dump --incremental" in GIT? GIT中是否有等同于“ svnrdump dump --incremental”的内容?

I am trying to incrementally backup several svn and git repos from a remote server to a local server but it seems that there is no direct way to "dump" a remote GIT repo. 我正在尝试从远程服务器增量备份几个svn和git仓库到本地服务器,但是似乎没有直接的方法来“转储”远程GIT仓库。

Basically I perform either " git fetch --all " with already existing or " git clone --mirror " for all new repos followed by " git bundle create --all ". 基本上,我对所有新仓库执行“ git fetch --all ”或对所有新仓库执行git clone --mirror ”,然后执行“ git bundle create --all ”。

Is there any other/better solution than that? 除此之外还有其他/更好的解决方案吗?

Once a full bundle is created , you can create new incremental bundles. 创建完整捆绑包后 ,您可以创建新的增量捆绑包。

I have mentioned in this answer a script to make incremental bundles (except once a wekk a full bundle) for all my repos. 我在这个答案中提到了一个脚本,可以为我的所有存储库制作增量捆绑包 (一次完整打包除外)。

echo "Create INCREMENTAL backup for '${name}' (previous was ${_dd}-${_dt}[${s}]" >> "${logf}"
echo "${nowd} Create INCREMENTAL backup for '${name}' (previous was ${_dd}-${_dt}[${s}]" >> "${logfb}"
git -C "${path}" bundle create "${bkp}/${name}-${nowd}-${describe}-incr.bundle" --since=${nbd}.days.ago --all
status=$?

The OP confirms in the comment : OP 在评论中确认:

I ended up doing a " git bundle create " after " git fetch --all " and/or " git clone --mirror " 我最终在“ git fetch --all ”和/或“ git clone --mirror ”之后进行了“ git bundle create

This question is hilarious. 这个问题很有趣。 Git (merely by virtue of being a DVCS) is by nature always an "incremental backup". Git(仅由于是DVCS而已)本质上始终是“增量备份”。 One might say it is always "dumped". 有人可能会说它总是 “倾销”的。 If a remote is set (ie, you've cloned the remote repository), git fetch / git pull will bring it up to date. 如果设置了远程(即,您已经克隆了远程存储库),则git fetch / git pull将其更新。

If what you need is the repository to be packaged as a single file, I would recommend you take a look at a program called tar . 如果您需要将存储库打包为单个文件,那么我建议您看一下一个名为tar的程序。 If you're sure you want a full mirror (tracking the same remotes), to dump a git repo to a single file: tar c .git > /path/to/my-repo-tarball.tar . 如果确定要使用完整的镜像(跟踪相同的远程服务器),请将git repo转储到单个文件中: tar c .git > /path/to/my-repo-tarball.tar

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM