不像这篇文章,我使用的是macOS。

我已经在GitLab中配置了密码。我也有一个SSL密钥创建后的项目是在GitLab。

当我在新项目中使用现有文件夹并执行以下步骤时,系统会提示我输入GitLab用户名和密码。

现有的文件夹

cd existing_folder
git init
git remote add origin https://gitlab.com/sobopla/Geronimod.git
git add .
git commit -m "Initial commit"
git push -u origin master

输入密码后,我得到以下错误。

remote: HTTP Basic:拒绝访问 致命:“https://gitlab.com/myname/myproject”认证失败


当前回答

您可以尝试以下命令:

git config --system --unset credential.helper

然后,输入Git远程服务器的新密码。

其他回答

我有同样的问题,我遵循这些步骤,它已经解决了。 步骤1:—设置用户名和密码 步骤2:- git push -f origin

进入Windows凭据管理器(按Windows键并键入' Credential '),在Windows凭据下编辑git条目。请用新密码替换旧密码。

打开windows电脑上的证书设置,删除https://gitlab.com/sobopla/Geronimod.git

对我来说,我创建了一个个人访问令牌,然后更新了我的git起源,如下所示:

https://<personal_access_token_name>:<personal_access_token>@gitlab.com/username/your-project.git

进入控制面板->凭据管理器->Windows凭据选择github或gitlab凭据并修改它。这是针对windows10的