我试图在Linux上以多用户和多项目模式配置Gitlab / Git
我有两个本地存储库
问题:
如果我在url中创建指定登录名的存储库,则本地配置将包含此凭据,我们只能使用此凭据。所以我们失去了知道谁在远程推送什么的能力
git clone https: // login@ url / xxx/ yyy.git
糟糕的解决方案:
在全局config =>中重新指定遥控器我们将无法在其他存储库上工作
理想的解决方案:
我们应该能够克隆目录而不在url中指定用户:
git clone https: // @ url / xxx/ yyy.git
Git每次都会询问用户/ passwd
Gitlab不允许这样做;发出以下错误:
git clone https://url/xxx/yyy.git
Initialized empty Git repository in /path/.git/
error: The requested URL returned error: 401 Unauthorized while accessing https://url/xxx/yyy.git/info/refs
fatal: HTTP request failed
提前感谢您的帮助
答案 0 :(得分:1)
请检查您当地计算机上安装的当前git
版本。
该命令将是:git --version
确保您拥有git 1.7.10或更高版本。在该版本之后,它应该提示输入用户名和密码。
Gitlab远程URL是(没有特定的用户名):
https://domain/owner_name/repository_name.git
git@domain:owner_name/repository_name.git
答案 1 :(得分:0)
您应该使用最新版本的git。尝试安装它。之后,您将能够克隆它。