How can I create an archive with gitpython, I tried the following which creates the file but I can't open it it tells me an error occurred reading archive the archive appears to be invalid or damaged
from git import *
repo = Repo(repo_path)
assert repo.bare == False
repo.archive(open("repo.tar",'w'))
I would like to create a zip file so then I tried this but here it creates an empty zip file (the path to repo is correct as when I use repo.clone it propery clones everything)
repo.archive(open("repo.zip",'w'), format="zip")