libgit2 / libgit2/pygit2

Cannot fetch unless a remote is defined

未关闭
#1,060 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

feature
主要语言
Python
星标
1.7k
派生
408
平均合并
2 天 57 分钟
30 天内合并 PR
7

描述

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?

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先检查 pygit2 现有的远程定义以及 fetch/push 入口,同时对照 issue 中描述的 git CLI 行为。确定如何在不创建具名远程的情况下仅使用 URL 执行 fetch 和 push,然后通过针对性测试验证该行为;当这两个操作都能接受 URL 而无需仓库配置时,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
git, python
领域
api
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。