libgit2 / pygit2

Python bindings for libgit2
https://www.pygit2.org/
Other
1.59k stars 383 forks source link

Cannot fetch unless a remote is defined #1060

Open basak opened 3 years ago

basak commented 3 years ago

Hi,

Thank you for pygit2! I'm using it extensively for git tooling in Ubuntu, but occasionally I find some corner where a feature doesn't exist and I have to resort to calling a git subprocess.

The git CLI allows me to use git fetch without having a remote defined. I can just specify a URL. I can't find any documentation on this in pygit2 though. It looks like I have to define a remote, with a name, first. Since I don't necessarily own the repository, this requires an ugly workaround because I have to be concerned about name collisions, crashing without having removed a temporary remote, etc.

Any chance of adding API functionality to fetch (and presumably) push against remotes with just a URL and no mandatory repository configuration please?