我使用了这个命令来更改它:“git config --global user.name“rest_ankit””,但它没有起作用。它仍然要求错误用户名的密码,并显示身份验证失败。
请帮帮我。谢谢。
git remote set-url https://rest_ankit@bitbucket.org/username/reponame.git
bitbucket.org
,而是bitbucket.org/username/reponame.git
,将username
和reponame
替换为正确的值。
git config user.name
无关:后者用于提交作者身份,而不是在推送/拉取期间进行身份验证。查看 提交 69e104d, 提交 813f602, 提交bc94e58(2020年1月22日),由布莱恩·M·卡尔森(bk2204
)完成。
(由Junio C Hamano -- gitster
--在提交c9ccf9d中合并,2020年1月30日)
在此处讨论。
doc
:提供用户名称格式指导署名:brian m. carlson
有一种常见误解,即user.name
变量在某种程度上控制身份验证,因此,新手们经常尝试更改它以解决身份验证问题。
文档规定,该变量代表某种形式的人类个人姓名,尽管这并不是必需的。
此外,解决Unicode是否受支持的问题。
使用术语“个人姓名”,因为这很可能引起预期对比,适用于可能具有不同命名约定的文化,并且易于理解非英语为母语的人。
表明按惯例使用“某种形式”,因为人们可能使用昵称或首选名称而不是全名。
将可能对身份验证感到困惑的用户指向适当的配置选项。
在配置选项描述中提供此信息的缩写形式。
因此,git config user man page 解释了:
name
形式的这些变量通常指代某种个人名称。
git commit
包括:
COMMIT INFORMATION
Author and committer information is taken from the following environment variables, if set:
GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_AUTHOR_DATE GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL GIT_COMMITTER_DATE
(nb "
<
", ">
" and "\n
"s are stripped)The author and committer names are by convention some form of a personal name (that is, the name by which other humans refer to you), although Git does not enforce or require any particular form.
Arbitrary Unicode may be used, subject to the constraints listed above.
This name has no effect on authentication; for that, see thecredential.username
variable, used in gitcredentials.
ssh
git remote set-url origin git@bitbucket.org:{new team or account name}/{repository name}.git
https
git remote set-url origin https://{username}@bitbucket.org/{new team or account name}/{repository name}.git
git remote -v
git remote set-url --push origin git@bitbucket.org:{new team or account name}/{repository name}.git
关于 https
git remote set-url --push origin https://{username}@bitbucket.org/{new team or account name}/{repository name}.git
origin
。 - kaybee99
git config --global url."https://myusername@github".insteadOf https://github
- VonC