github - 克隆 GitHub 存储库时 SourceTree 出现问题

标签 github atlassian-sourcetree

我知道这里已经发布了类似的问题,但是我认为我的情况有点不同。这是我所拥有的。

我下载并安装了SourceTree软件的最新官方版本。此外,我有 GitHub 帐户,有权克隆和推送存储库。为了管理本地副本,我需要克隆在线版本。以下是我采取的步骤:

  • 启动 SourceTree 并导航到 文件 -> 克隆/新建 ...
  • 在打开的窗口中,我粘贴了 HTTPS 克隆 URL .我是登录GitHub账号后从浏览器复制的,所以链接是正确的。
  • 嵌套步骤是指定将复制存储库的本地文件夹。但是当我点击进入目标路径 ,窗口显示错误:

    This is not a valid source path / URL



    单击错误可能会提供详细信息:

    remote: Repository not found.
    fatal: repository 'https://github.com/org/repo.git/' not found
    remote: Repository not found.
    fatal: repository 'https://github.com/org/repo.git/' not found
    

  • 或者,详情可能是空的。 SourceTree 没有告诉我错误的原因或其他任何事情。

    我尝试重新安装 SourceTree,但错误仍然存​​在。我向 GitHub 存储库的管理部门询问了任何其他权限,但我的帐户拥有所有权限。我可以使用终端控制台将更改推送到在线存储库,但我想使用 UI(SourceTree 提供的)来管理和比较代码中的更改。

    有人认为我没有尝试使用另一个 GtHub 帐户克隆存储库。但我不想这样做,因为我需要代表我提交对存储库的任何更改。

    有谁知道如何修复或解决此错误?

    最佳答案

    确切的错误消息是(如 illustrated here ):

     This is not a valid source path / URL
    

    error message in sourcetree

    可能的原因:
  • 代理设置(如 this thread )
  • 设置步骤,禁用 Git(如 in here)

    When SourceTree started for the first time, I skipped setting up Git & Mercurial in the wizard. Then I reran the wizard and chose to download and install the embedded packages.
    But it seems installing those didn't actually enable them - in the Tools -> Options dialogue they were both disabled!
    Enabling Mercurial (or Git in your case) allowed the clone dialogue to correctly identify the repo.

  • 凭证问题(如 in here,来自我的 old answwer)
  • 关于github - 克隆 GitHub 存储库时 SourceTree 出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20718193/

    相关文章:

    git - 关于切换回空主分支的上游消失消息?

    git - 如何将所有以前的提交 merge 为一个提交?

    go - 如何创建一个go项目? [复制]

    git - SourceTree - 远程 : Unauthorized

    git - 如何在 SourceTree 中使用 VS Code 作为 merge 和差异工具?

    macros - SourceTree点击 ' terminal button'切换终端不工作

    git - 恢复到 bitbucket 中之前的更改

    Github 组织 "remote: Repository not found."通过 HTTPS 克隆

    git - 使用 Git 克隆时仅选择文件夹的子集

    git - 使 gh-pages 与 master 的最新提交保持同步