【问题标题】:Permission denied when pushing to repository with git使用 git 推送到存储库时权限被拒绝
【发布时间】:2016-02-21 09:07:58
【问题描述】:

当我使用命令git push -u origin master 时,我得到了错误

Permission denied (publickey)
fatal: Could not read from remote repository

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

我使用的是 Windows 10。

我猜我没有正确登录。

我在GIT push: permission denied (public key) 看到了答案,但是我不能使用命令ssh。我猜是因为我在 Windows 机器上。

此外,Github 表示建议使用 https 来支持使用 ssh。

【问题讨论】:

    标签: git ssh version-control repository push


    【解决方案1】:

    如果你使用的是 Windows 机器,那么有一个扩展名为

    git extension
    

    下载后,您必须使用 git 扩展名让您的 ssh 文件从 git 服务器推送或拉取。

    您可以在您的 git 服务器帐户中创建 SSH 文件。之后你可以使用 git extension 试试这个

    【讨论】:

    • 我收到错误git: 'extension' is not a git command. See 'git --help'.
    • 它是一个用于 git 服务器的 GUI 应用程序。它不是命令。下载名为 git extension 的应用程序并进行配置。这是一个简单的步骤过程
    • GitExtensions 是具有相当智能的 Git 的 GUI 客户端(其中之一)SSH-settings
    【解决方案2】:

    您必须从 git 存储库中执行命令。 IE。, 包含 .git 文件的文件夹

    【讨论】:

    • 我确实从 git rep 内部执行命令。我已经用git init 初始化,用git add README.md 添加了一个新文件,用git commit -m "commit msg" 提交,用git remote add origin git@github.com:username/rep-name.git 添加了原点,但现在我无法推送到代表
    猜你喜欢
    • 2012-11-20
    • 2019-06-09
    • 2013-01-17
    • 2020-08-29
    • 2014-11-28
    • 2018-10-24
    • 2014-02-01
    • 2015-12-19
    • 2010-10-29
    相关资源
    最近更新 更多