My goal is to access existing Git repos from Python. I want to get repo history and on demand diffs.
In order to do that I started with dulwich. So I tried:
from dulwich.repo import Repo
Repo.init('/home/umpirsky/Projects/my-exising-git-repo')
and got OSError: [Errno 17] File exists: '/home/umpirsky/Projects/my-exising-git-repo/.git
The doc says You can open an existing repository or you can create a new one.
.
Any idea how to do that? Can I fetch history and diffs with dulwich? Can you recommand any other lib for Git access? I am developing Ubuntu app, so it would be appriciated to have ubuntu package for easier deployment.
I will also check periodically to detect new changes in repo, so I would rather work with remote so I can detect changes that are not pulled to local yet. I'm not sure how this should work, so any help will be appriciated.
Thanks in advance.