What is the best practice for backing up All my git repos backup on s3?

Viewed 1065

I am using bitbucket cloud as my git host and I have around 200 repos. I wish to backup all my repos including (all branches) on AWS S3 bucket daily.

We are several people who works on the same account ( 100+ repos) although no one have the permission to delete a repo we can all delete the content of a repo by making git reset --hard <init_commit> and then git push --force. according to bitbucket backup we observe that there is no auto backup therefore I wish to create one

I thought of using AWS code builder for it but if I understand from the docs correctly, it is only for 12 repos max for project.

As I am sure I am not the first person who try solve it, I am trying to understand what is the best practice for such a requirement?

The default, which I hope to avoid would be a lambda+ bitbucket api + cloud watch.

Thx in advance

1 Answers

A simple approach for backup is to use git bundle: that produces one file per repository (with all their history and branches)

Once you have those files locally, you can then save them to S3: one file per repo is easier/quicker to save/sync than pushing lots of small files.

Related