代码之家  ›  专栏  ›  技术社区  ›  julienfr112

如何将ssh与github结合使用,它似乎是在自己切换到https?

  •  1
  • julienfr112  · 技术社区  · 8 年前

    我使用“ssh”方法克隆了一个repo,但是,在remote中有一个https方法,git push正在询问密码??

    git clone git@github.com:julienfr112/random.git
    cd random
    git remote -v
    
    origin    https://github.com/julienfr112/random.git (fetch)
    
    origin    https://github.com/julienfr112/random.git (push)
    
    cat .git/config
    
    [remote "origin"]
    
    url = git@github.com:julienfr112/random.git
    
    fetch = +refs/heads/*:refs/remotes/origin/*
    

    搞什么鬼?

    1 回复  |  直到 8 年前
        1
  •  0
  •   thiruclassic    8 年前

    您是否已将SSH密钥添加到github帐户???

    如果是,请尝试使用以下命令设置远程原点:

    git远程设置url源git@github.com: / .吉特

    如果没有,您需要先将SSH密钥添加到您的帐户,然后重试。。。

    推荐文章