`git push origin< branchname>`抛出错误`HTTP Basic:Access denied` [英] `git push origin <branchname>` throws error `HTTP Basic: Access denied`

查看:1477
本文介绍了`git push origin< branchname>`抛出错误`HTTP Basic:Access denied`的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Git新手(刚刚2天前开始)。我试图创建一个项目来练习我从



问题:


  • 即使使用正确的用户名和密码,为什么我无法成功推送?我是否错过了某些东西,或者我在这方面做了什么错误?

  • 有没有办法消除每次推送东西时必须输入凭据的步骤?



请帮忙。


注意:我曾见过

解决方案

这些是我的想法:




  • 试试看它是否适用于Git Bash

  • 您是否为您的帐户添加了ssh密钥?如果是删除它,然后再试一次。
  • 您不一定需要Tortoise Git,但它也可能解决您的问题。

  • 尝试在没有 Git Credential Manager for Windows的情况下重新安装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.

Where I am, so far:

  • [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>
  • [success] Clone the project into my local folder C:\gitprojects with the command git clone https://flamedenise19@gitlab.com/flamedenise19/speedtyping.git

  • [success] Create a local branch with the command git checkout -b "develop".
  • [success] Manually add a new file test.txt on local root folder for test pushing.
  • [success] Commit the new file with the command git commit -m "adds test.txt"
  • [attempting] Push the commit with the command 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):

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/'

QUESTIONS:

  • Why can't I push successfully, even with the correct username and password? Am I missing something or have I done something wrong along the way?
  • Is there a way to remove the step of having to enter my credentials everytime I push something?

Please help.

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

SOME BACKGROUND INFO:

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

解决方案

These are my ideas:

  • 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&lt; branchname&gt;`抛出错误`HTTP Basic:Access denied`的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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