【问题标题】:Cannot git push to Github无法 git 推送到 Github
【发布时间】:2019-04-24 15:20:50
【问题描述】:

我在 Github 网站上创建了一个新的 Github 存储库,然后 git 在我的本地机器上克隆了它。 在本地进行一些更改后,我提交了更改并尝试将其推送到远程仓库,但它失败并显示以下消息:

Learn.NET git:(master) git push
ERROR: Permission to GITHUB_ACCOUNT1/Learn.NET.git denied to GITHUB_ACCOUNT2.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

上下文: 我有两个 Github 帐户,我在 GITHUB_ACCOUNT1 上创建了这个 repo,但不知何故,它试图使用我的 GITHUB_ACCOUNT2 帐户凭据来推送,我怎样才能让自己在这个目录中可推送?

我已经在本地机器上配置了 ssh。

【问题讨论】:

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


    【解决方案1】:

    我自己整理的。

    这个命令很神奇:

    git remote set-url origin https://github.com/GITHUB_ACCOUNT1/Learn.NET.git
    

    在此之后,我能够 git push 到远程。

    【讨论】:

      猜你喜欢
      • 2011-11-24
      • 2012-06-21
      • 2018-02-27
      • 2013-05-30
      • 2011-12-09
      • 2012-09-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多