首页 > 解决方案 > 在哪里存储存储在 Windows 10 上的 GitLab/git 凭据?

问题描述

我试图找出在远程 Windows 10 环境中的 GitLab 中存储我的个人访问令牌 (PAT) 生成的位置,以在该 GitLab 实例上进行身份验证。

假设我已经在共享驱动器上有一个本地 git repo,我可以以自己的身份登录到我的环境,进行身份验证并像这样设置我的遥控器:

git remote set-url https://{my username}:{my access token}@{repo name}.git

这为我提供了身份验证,当我提交和推送时,我在 gitlab 实例中被正确识别。

但是,如果我注销并且同事登录并进入同一个共享驱动器上的同一个仓库,则远程将为我而不是他们进行身份验证。那就是遥控器看起来像这样:

git remote -v
> origin  https://{my username}:{my access token}@{repo name}.git (fetch)
> origin  https://{my username}:{my access token}@{repo name}.git  (push)

这没有任何好处,因为我的同事必须要么 a) 在他们想要使用遥控器的任何时候重置 git 遥控器,要么 b) 使用我的 PAT 进行身份验证。谁能推荐一种存储用户名和 PAT 的方法,使遥控器看起来更像这样:

git remote -v
> origin  https://{repo name}.git (fetch)
> origin  https://{repo name}.git  (push)

标签: windowsgitgitlabremote-desktop

解决方案


推荐阅读