V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
bwangel
V2EX  ›  GitHub

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

  •  
  •   bwangel ·
    bwangelme · Apr 1, 2016 · 5427 views
    This topic created in 3684 days ago, the information mentioned may be changed or developed.

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

    @virusdefender ,这样啊,谢谢!
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   782 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 21:37 · PVG 05:37 · LAX 14:37 · JFK 17:37
    ♥ Do have faith in what you're doing.