1

Is there an equivalent to "svnrdump dump --incremental" in GIT?

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.

Basically I perform either "git fetch --all" with already existing or "git clone --mirror" for all new repos followed by "git bundle create --all".

Is there any other/better solution than that?

2 Answers2

1

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:

I ended up doing a "git bundle create" after "git fetch --all" and/or "git clone --mirror"

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks for your hints, VonC! I ended up doing a "git bundle create" after "git fetch --all" and/or "git clone --mirror". Not sure but seemed to me the closest solution to my initial request... – user3752299 Jun 24 '14 at 15:49
  • @user3752299 Ok, I have included your conclusion in the answer for more visibility. – VonC Jun 24 '14 at 16:45
0

This question is hilarious. Git (merely by virtue of being a DVCS) is by nature always an "incremental backup". One might say it is always "dumped". If a remote is set (i.e., you've cloned the remote repository), git fetch / git pull will bring it up to date.

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. 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.

Geoff Nixon
  • 4,697
  • 2
  • 28
  • 34