每当我试图从设备推送到GitLab服务器时,我总是会出错。
remote: HTTP Basic: Access denied. The provided password or token is incorrect or your account has 2FA enabled and you must use a personal access token instead of a password. See https://gitlab.com/help/topics/git/troubleshooting_gi
t#error-on-git-fetch-http-basic-access-denied
在回应之前,听我说完,我知道有很多类似的问题,比如
GitLab remote: HTTP Basic: Access denied and fatal Authentication
但这是我的问题所在,这个问题只发生在一个项目上,对于相同设备和相同位置(我指相同的SSD)到同一个Gitlab帐户的其他项目,我没有问题,可以推拉而不出任何问题。
我可以使用访问令牌来解决这个问题,但是为什么只需要一个项目而不是其他项目呢?
PS:我的编辑和终端都面临着这个问题
发布于 2022-09-03 23:26:19
首先检查用于推送的确切URL:
cd C:\path\to\repository
git remote -v
因为您已经在本地创建了它们,这意味着您必须在某个时候设置了远程“原产地”。(git remote add origin https://gitlab.com/you/YourRemoteRepo
)
还检查缓存的凭据。
在CMD中,确保:
<path/to/Git>/mingw64/bin
在您的%PATH%
/$PATH
中:这是git-credential-manager-core
将驻留的地方(对于最近的Git版本无论如何是2.35+)。<path/to/Git>/usr/bin
位于%PATH%
/$PATH
:这是printf
将驻留的位置(对于没有内置shell printf
命令的%PATH%
OS )。H 215F 216
从那里:
printf "host=github.com\nprotocol=https" | git credential-manager-core get
https://stackoverflow.com/questions/73593974
复制相似问题