如何解决git中的错误403?

时间:2017-11-05 14:02:50

标签: github

我在我的git帐户中创建了一个空白的git repo,我正在尝试使用git bash将代码从本地计算机推送到它。 我使用的命令是:

* https://github.com/DevanshiParekh/new-git-project.git
* git push -u origin master

执行此操作时出现以下错误:

$ git push -u origin master
remote: Permission to DevanshiParekh/new-git-project.git denied to debo-prk.
fatal: unable to access 'https://github.com/DevanshiParekh/new-git-project.git/': The requested URL returned error: 403

这是我的配置列表:

user.name=DevanshiParekh
user.email=devanshiparekh63@gmail.com
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
filter.lfs.clean=git-lfs clean -- %f
color.ui=auto

$ git remote show origin
* remote origin
  Fetch URL: https://github.com/DevanshiParekh/new-git-project.git
  Push  URL: https://github.com/DevanshiParekh/new-git-project.git
  HEAD branch: (unknown)

有人可以帮我解决此错误吗? 提前谢谢。

2 个答案:

答案 0 :(得分:1)

第一次推送时,https网址应查询您的GitHub用户名/密码(配置user.name / user.email与身份验证无关)

如果没有,则凭证帮助程序中会缓存错误的凭据 查看git config credential.helper的结果,了解您拥有哪一个 例如,在Windows上,那将是Windows Credential Managers

另一个原因(您的用户名/密码不起作用)将是if you have activated the 2FA。在这种情况下,您需要使用PTA (Personnal Access Token)

答案 1 :(得分:0)

<myContext.Consumer>{(contextData) => {return(<div>{myContextData}</div>}}</myContext.Consumer>
相关问题