Remote anonymous access to repository denied?

后端 未结 5 950
借酒劲吻你
借酒劲吻你 2021-02-20 04:49

I\'m on Ubuntu 12.04 LTS and just upgraded my git from 1.7-something to version 1.8.4. The problem is when I want to push to a GitHub repo

5条回答
  •  后悔当初
    2021-02-20 05:27

    If you want to use your SSH key, you must use the following format:

    $  on MBP-0x00A3 in ~/misc/vim_dotfiles
    ✭ (git) working on branch alternate ✔
    ❯❯ git remote -v
    origin  https://github.com//vim_dotfiles.git (fetch)
    origin  https://github.com//vim_dotfiles.git (push)
    
    $  on MBP-0x00A3 in ~/misc/vim_dotfiles
    ✭ (git) working on branch alternate ✔
    ❯❯ git remote add personal git@github.com:/vim_dotfiles.git
    
    $  on MBP-0x00A3 in ~/misc/vim_dotfiles
    ✭ (git) working on branch alternate ✔
    ❯❯ git remote -v
    origin  https://github.com//vim_dotfiles.git (fetch)
    origin  https://github.com//vim_dotfiles.git (push)
    personal    git@github.com:/vim_dotfiles.git (fetch)
    personal    git@github.com:/vim_dotfiles.git (push)
    

    Now you can do:

    user@host:~$ git push personal 
    

    and it will force use of your SSH key.

提交回复
热议问题