推送到gitlab时要求输入密码?

Kat*_*ieC 3 git ssh bash vpn gitlab

我的笔记本电脑上有许多提交,我正在尝试通过 ShrewSoft VPN 将这些提交到 gitlab。然而,每次我尝试推送代码时,都会要求我在 git bash 中输入密码。我尝试过使用我的 VPN 密码,但它只是抛出错误。我昨天添加了 SSH 密钥,一切正常,但今天它不起作用,我不太清楚为什么!

关于密码应该是什么以及为什么首先要求我输入密码有什么想法吗?

谢谢。

Ste*_*anS 7

密码是gitlab密码,查看remote_url,

git config --get remote.origin.url
Run Code Online (Sandbox Code Playgroud)

如果是这样的类型

git@github.com:jcjohnson/neural-style.git
Run Code Online (Sandbox Code Playgroud)

然后您应该检查本地 ssh 密钥是否位于正确的位置: https: //help.github.com/articles/checking-for-existing-ssh-keys/

如果 url 的类型是

https://github.com/jcjohnson/neural-style.git
Run Code Online (Sandbox Code Playgroud)

您应该在 git 中设置全局用户和密码

https://help.github.com/articles/why-is-git-always-asking-for-my-password/