美文网首页
Mac上提示You won‘t be able to pull

Mac上提示You won‘t be able to pull

作者: 越来越胖了 | 来源:发表于2023-06-26 16:36 被阅读0次

    1. 打开终端,确认是否安装git (git都没有的话,别玩了,把电脑关机吧)

    lepu@zsyLepu ~ % git --version
    git version 2.39.2 (Apple Git-143)
    

    2. 已经安装,则直接生成密钥

    通过指令 ssh-keygen -t rsa -C 'xxxx@viatom.cc' xxxx@viatom.cc是自己的git邮箱

    lepu@zsyLepu ~ % ssh-keygen -t rsa -C 'xxxx@viatom.cc' 
    Generating public/private rsa key pair.
    Enter file in which to save the key (/Users/lepu/.ssh/id_rsa): 
    /Users/lepu/.ssh/id_rsa already exists.
    Overwrite (y/n)? y    //已经生成过,直接覆盖 y
    Enter passphrase (empty for no passphrase):  //直接回车
    Enter same passphrase again:  //直接回车
    Your identification has been saved in /Users/lepu/.ssh/id_rsa
    Your public key has been saved in /Users/lepu/.ssh/id_rsa.pub
    The key fingerprint is:
    SHA256:/GIAwcEjsrWGlIH3d+MF8eze8OfxbOf2/1guOxZ6d74 xxxx@viatom.cc
    The key's randomart image is:
    +---[RSA 3072]----+
    |..ooo.  ..       |
    |oo+ +.  .o       |
    |.* +..   .o      |
    |o o ....o..      |
    | .   ..oSoo      |
    |       ..o +  .  |
    |        o o o.o..|
    |       . .  .o=B*|
    |             o+E^|
    +----[SHA256]-----+
    

    3. 到上面提到的文件夹中查找

    image.png

    注:mac可以通过文本编辑工具打开.pub文件 ,复制里面的内容


    image.png

    4. 到git仓库网页中,找到 SSH Keys 添加即可

    image.png

    相关文章

      网友评论

          本文标题:Mac上提示You won‘t be able to pull

          本文链接:https://www.haomeiwen.com/subject/ofqgydtx.html