Skip to content

Clone / Init:补上仓库创建入口 #11

Description

@zjywill

现状

全代码库没有 clone 相关实现,入口只有 Open Repository…Sources/TheGit/TheGitApp.swift:60 / :134)。用户第一次打开 app 时,如果本地没有已存在的仓库,无路可走。

目标

补上仓库的「创建」入口,让漏斗第一步能走通。

  • Clone:URL 输入框 + 目标目录选择 + 进度显示 → git clone
  • Init:目录选择 → git init,完成后直接开 tab

实现要点

  • GitClient 现在是 init(repoPath:) 绑定单仓库的 actor,clone/init 发生在「还没有仓库」的时刻,需要一个不绑定 repoPath 的静态入口(或直接走 Shell.run)。
  • clone 有长时间进度输出,Shell.run 目前是一次性收集 stdout,需要支持流式读取才能显示进度。
  • 认证:SSH 走系统 agent;HTTPS 沿用现有策略(GIT_TERMINAL_PROMPT=0),失败时提示用户先 gh auth login

优先级

P0 —— 对照 Sourcetree 时发现的最大功能缺口。成本低,影响面最大。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions