Page tree
Skip to end of metadata
Go to start of metadata

SubGit as of version 2.0 does not provide integrated backup solution. Standard Git tools should be used to back up repositories.

Backup Git Repository:

First, disable Git pushes and then disable SubGit synchronization (single Git repository is assumed):

# make user-pre-receive hook reject all pushes:
$ cp /var/git/repos.git/hooks/user-pre-receive /var/git/repos.git/hooks/user-pre-receive.backup
$ echo '#!/bin/sh\nexit 1' > /var/svn/repos/.git/hooks/user-pre-receive

# disable synchronization
$ subgit uninstall /var/git/repos.git

uninstall command will wait for ungoing translation to complete and will then shutdown background translation process. Marke sure that it is not running by running jps command and checking that there is no Java process named SubGitDaemon. Then, back up everything, reinstall SubGit and enable synchronization and Git pushes back:

# back up all data
$ copy -R /var/git/repos.git repos.git.backup

# enable synchronization
$ subgit install /var/git/repos.git

# make user-pre-receive hook no longer reject pushes
$ rm /var/git/repos.git/hooks/user-pre-receive
$ cp /var/git/repos.git/hooks/user-pre-receive.backup /var/git/repos.git/hooks/user-pre-receive
  • No labels