"git push origin MyBranchName"引发错误"HTTP Basic:访问被拒绝"; [英] 'git push origin MyBranchName' throws error "HTTP Basic: Access denied"

查看:81
本文介绍了"git push origin MyBranchName"引发错误"HTTP Basic:访问被拒绝";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Git的新手(仅两天前开始).我正在尝试创建一个项目,以实践从这里.

I am new to Git (just started 2 days ago). I'm attempting to create a project to practice the basic commands I've learned from here.

到目前为止,我在哪里

  • [成功] 创建一个新的公共git项目(因为我之前尝试过private和internal,但无法克隆它,也不知道为什么). 在这里.
  • 在项目中添加了README.md.
  • [成功] 创建一个名为develop的新分支.
  • [成功] 在我的本地文件夹C:\gitprojects中,使用以下命令设置全局user.nameuser.email:

  • [success] Create a new public git project (because I tried private and internal before but I could not clone it, and I don't know why). Here it is.
  • Added a README.md into the project.
  • [success] Create a new branch named develop.
  • [success] In my local folder C:\gitprojects, set global user.name and user.email with the commands:

  • git config --global user.name <my user name>
  • git config --global user.email <my-email>
  • git config --global user.name <my user name>
  • git config --global user.email <my-email>

[成功] 使用命令git clone https://flamedenise19@gitlab.com/flamedenise19/speedtyping.git

现在,我被困在push部分.输入git push origin develop后,会弹出一个新窗口,要求我提供凭据(请参见下面的屏幕截图):

And now, I'm stuck with the push part. After entering git push origin develop, a new window pops up, asking for my credentials (see screenshot below):

所以我确实输入了我的凭据(登录gitlab.com时使用的用户名和密码相同),但是在此之后,我得到了这个错误(另请参见下面的屏幕截图):

So I did enter my credentials (the very same username and password I use when logging in to gitlab.com), but after that, I got this error (also see screenshot below):

remote: HTTP Basic: Access denied
fatal: Authentication failed for 'https://gitlab.com/flamedenise19/speedtyping.git/'

问题:

  • 为什么即使使用正确的用户名和密码也无法成功推送?我一路上缺少什么还是做错了什么?
  • 是否有一种方法可以消除每次我推送内容时都必须输入凭据的步骤?

请帮助.

注意::我见过 一个" ,答案是提到乌龟.是否总是需要使用乌龟才能 使用Git吗?

NOTE: I have seen THIS ONE, and the answers are mentioning Tortoise. Is it always required to use tortoise in order to use Git?

某些背景信息:

我的帐户的双重身份验证"已禁用(请参见下面的屏幕截图):

Two-Factor Authentication is disabled for my account (see screenshot below):

推荐答案

这些是我的想法:

  • 尝试一下它是否可以在Git Bash上运行
  • 您是否已将ssh密钥添加到您的帐户?如果是,请将其删除,然后重试.如果没有添加,请尝试ssh网址.
  • 您不一定需要Tortoise Git,但它也可以解决您的问题
  • 尝试在没有Git Credential Manager for Windows
  • 的情况下重新安装Git
  • Try if it works on the Git Bash
  • Have you added a ssh key to your account? If yes remove it and try again. If not add one and try the ssh url.
  • You don't necessarily need Tortoise Git but it may also work around your problem
  • Try to re-install Git without the Git Credential Manager for Windows

解决了推送问题后,您也可以在私有问题或内部问题时将其克隆.

When you've fixed the push problem you will also be able to clone it when it is private or internal.

这篇关于"git push origin MyBranchName"引发错误"HTTP Basic:访问被拒绝";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆