【问题标题】:Unable to push origin on public repo 2fa无法在公共回购 2fa 上推送来源
【发布时间】:2018-12-06 20:47:46
【问题描述】:

我正在尝试更新以下存储库https://github.com/ilyas-it83/CloudComparer

我克隆了它,对文件进行了一些更新,现在我尝试推送它以获取新的拉取请求。

我在我的 github 帐户上使用 2FA,所以在 stackoverflowing 之后我生成了访问密钥。

这是我的github版本

git version 2.19.1

这是我的本地 git 配置

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
    ignorecase = true
    precomposeunicode = true
[remote "origin"]
    url = https://wojciehm@github.com/ilyas-it83/CloudComparer.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master
[credential]
    username = wojciehm

我尝试将 url 更改为 ssh://blah,但没有成功。

这是我收到的错误。

git push origin add-wojciech-marusiak
Password for 'https://wojciehm@github.com':
remote: Permission to ilyas-it83/CloudComparer.git denied to wojciehm.
fatal: unable to access 'https://wojciehm@github.com/ilyas-it83/CloudComparer.git/': The requested URL returned error: 403

【问题讨论】:

  • 您可能没有创建自己的分叉,并且正在推动您不允许的项目(403)。从这里开始:guides.github.com/activities/forking
  • 就是这样。像魅力一样工作。

标签: git github git-push github-for-mac


【解决方案1】:

您是否拥有存储库,或者您是否正在尝试向其他人提交 PR?

听起来这只是someone else's repo you're trying to make a PR onto

如果是这种情况,您需要派生 repo,您​​可以在 repos 页面 (https://github.com/ilyas-it83/CloudComparer) 上执行此操作。

然后,一旦您做出更改,点击拉取请求,然后点击新的拉取请求并选择您的分叉存储库。

【讨论】:

  • 当我意识到这无关紧要时,我开始写一个更详细的“如何使用令牌”答案,因为这是几乎可以肯定的问题。
  • 就是这样。对不起,蹩脚的问题。这是我第一次尝试为其他存储库做出贡献。创建了新的拉:)
  • @wojcieh 不跛脚;每个人都需要从某个地方开始!
猜你喜欢
  • 2016-10-20
  • 1970-01-01
  • 1970-01-01
  • 2013-12-31
  • 1970-01-01
  • 2019-11-23
  • 1970-01-01
  • 2022-01-16
  • 2022-11-05
相关资源
最近更新 更多