gpt4 book ai didi

git - 如何在 github.com 上为双因素身份验证配置 Cygwin git?

转载 作者:行者123 更新时间:2023-12-05 08:34:29 28 4
gpt4 key购买 nike

我是一个 git 新手。我在 github.com 上使用双因素身份验证设置了一个帐户。

我可以将它与 MINGW32 bash shell 一起使用,但我正在尝试将它与 Cygwin 一起使用。

这是我得到的:

dave@ENOUGH /cygdrive/u/testG
$ git clone https://github.com/nerdfever/<project>
Cloning into '<project>'...
Username for 'https://github.com':
Password for 'https://Nerdfever@github.com':
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/nerdfever/<project>/'

我确实在 Cygwin git 中设置了 user.name 和 user.email 配置。

我需要做什么才能完成这项工作?

最佳答案

我不知道为什么有人对我投反对票,但无论如何我想通了:

Git under Cygwin:
a) Install git from Cygwin setup.exe
b) git config --global user.name "<username>"
c) git config --global user.password "<password>"
d) git config --global credential.helper store
e) Get personal access token per https://help.github.com/articles/creating-an-access-token-for-command-line-use/
f) git clone <project>; first time it'll ask for credentials, after that it will store them

请注意,当 git 询问您的密码时,请提供您的个人访问 token (而不是您的密码)。

关于git - 如何在 github.com 上为双因素身份验证配置 Cygwin git?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27156413/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com