forum/How to use myrepos to backup git repositories?myreposhttp://myrepos.branchable.com/forum/How_to_use_myrepos_to_backup_git_repositories__63__/myreposikiwiki2020-08-23T01:07:03ZPossible solutionhttp://myrepos.branchable.com/forum/How_to_use_myrepos_to_backup_git_repositories__63__/comment_1_24359afb58abb8865829e88ca9c933f8/benedikt.ahrens2020-08-22T19:34:58Z2020-08-22T19:34:58Z
<p>It took me a while, but for now I have found</p>
<pre><code>[DEFAULT]
backup = git bundle create /path/to/backupdir/$(basename $(git rev-parse --show-toplevel)).gitrepo --all
</code></pre>
<p>If anybody has any comments on how to improve this, please let me know.
Thanks,
Benedikt</p>
I would use restic/borg insteadhttp://myrepos.branchable.com/forum/How_to_use_myrepos_to_backup_git_repositories__63__/comment_2_b57a24bca774837661ba0e6fbd62ce93/PaulWise2020-08-23T01:07:03Z2020-08-23T01:07:02Z
<p>Personally I would do backups using a regular backup tool like restic or borg. This way you also backup the git config for each repository and any uncommitted changes or modifications to the index and you also get history of those things. Just using git bundle like that will miss those things.</p>
<p>BTW: my use of the mr backup command is per-repository and I use it to rsync remote repos locally. I then backup those with restic.</p>
<pre><code>[repos/chromium-bsu]
checkout = git clone 'https://git.code.sf.net/p/chromium-bsu/code' 'code'
backup = rsync --archive --compress --hard-links --delete --copy-unsafe-links git.code.sf.net::p/chromium-bsu/ ~/backup/repos/chromium-bsu/
</code></pre>