libgit2 / libgit2/pygit2

Cannot fetch unless a remote is defined

Open
#1,060 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
Python
Stars
1.7k
Forks
408
Avg merge
2d 57m
Merged PRs (30d)
7

Description

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?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing pygit2's existing remote-definition and fetch/push entry points alongside the git CLI behavior described in the issue. Determine how URL-only fetch and push should work without creating a named remote, then verify the behavior with focused tests; done means both operations accept a URL without requiring repository configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, python
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.