V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
bwangel
V2EX  ›  GitHub

向 Github 上 Push 代码时权限不允许

  •  
  •   bwangel ·
    bwangelme · 2016-04-01 08:37:56 +08:00 · 4921 次点击
    这是一个创建于 2949 天前的主题,其中的信息可能已经有所发展或是发生改变。

    万能的 V 友们,我又来求助了!

    我在本地创建了一个仓库 Config ,然后又在 Github 上创建了一个仓库 Config ,在本地通过

    git remote add origin [email protected]:/bwangel23/Config.git
    

    命令,指定了远端仓库。

    然后推送的时候出问题了,错误提示是这样:

    michael@vv2x:~/Bundle/Config$ git push [email protected]:bwangel23/Config.git
    ERROR: Permission to bwangel23/Config.git denied to deploy key
    fatal: Could not read from remote repository.
    
    Please make sure you have the correct access rights
    and the repository exists.
    

    问题是我已经在 Github 上添加了我这台主机的 SSH 公钥啊,我执行 ssh 命令是可以的,

    michael@vv2x:~/Bundle/Config$ ssh -T [email protected]
    Hi bwangel23/k-vim! You've successfully authenticated, but GitHub does not provide shell access.
    

    我看这个错误应该是 Config 这个仓库禁止通过deploy key的方式来推送代码,我找了半天设置,也没找到允许通过deploy key部署代码的办法。

    对了,我还试过在 Config -> Settings -> Deploy Keys 中添加主机公钥,添加失败,说是公钥已经被使用了。

    请问大家有遇到这种问题吗?该怎么解决啊?

    3 条回复    2016-04-01 09:26:13 +08:00
    hging
        1
    hging  
       2016-04-01 08:40:43 +08:00 via iPhone   ❤️ 1
    你没有那个仓库的修改权限 你需要了解下 github-flow 的工作流程
    virusdefender
        2
    virusdefender  
       2016-04-01 08:43:01 +08:00 via Android   ❤️ 1
    deploy key 就是只读的,,只能 pull ,你要删掉 deploy key ,添加真正的 ssh key
    bwangel
        3
    bwangel  
    OP
       2016-04-01 09:26:13 +08:00
    @hging 嗯,搜到了一个 https://guides.github.com/introduction/flow/ ,一会去看看。

    @virusdefender ,这样啊,谢谢!
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5403 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 56ms · UTC 08:29 · PVG 16:29 · LAX 01:29 · JFK 04:29
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.