来自Bitbucket服务器的Git克隆不适用于https

问题描述

我正在尝试将存储库从专用bitbucket服务器克隆到我的os x计算机。 如果我使用git clone ssh://git@repositoryname:0001/subfolder/reponame.git效果很好,但是当我尝试致电git clone https://repositoryname/subfolder/reponame.git时,我得到fatal: remote error: Repository not found The requested repository does not exist,or you do not have permission to access it.。网址似乎是正确的,因为我使用Sourcetree成功克隆了它,但是为什么我在通过控制台执行git clone时遇到此错误

解决方法

首先检查通过命令行(不是SourceTree)进行克隆时是否设置了凭据帮助程序

git config credential.helper

如果这样做,请尝试使用期望的用户名克隆它,然后查看是否弹出窗口要求您输入帐户密码。

git clone https://<GitLabAccount>@repositoryname/subfolder/reponame.git