"傻瓜式" Sourcetree怎么提交代码到码云

1、在终端下生成SSHKey

  • ssh-keygen -t rsa -C "你的邮箱"

  • 出现提示


    Generating public/private rsa key pair.
    Enter file in which to save the key (/Users/wei942/.ssh/id_rsa):


    2、直接回车,保存密钥对保存到默认位置/Users/你的Mac用户名/.ssh/id_rsa

    出现提示


    Enter passphrase (empty for no passphrase):


    3、输入密码密钥对的密码,一般不设置,直接回车,再次回车

    出现提示


    Your identification has been saved in /Users/wei942/.ssh/id_rsa.
    Your public key has been saved in /Users/wei942/.ssh/id_rsa.pub.
    The key fingerprint is:
    SHA256:GGdJBO5EIhN7pPft8fsytBvD4WrJCCfmVEnOYbrHOOQ [email protected]
    The key's randomart image is:
    +---[RSA 2048]----+
    | +.o ooo |
    | * ++. . |
    | o o+o+ |
    | oo+=
    |
    | o =+ S . |
    | E +. =.. |
    | + * o.o*. |
    | . . +.++ |
    | .. o=. |
    +----[SHA256]-----+


    4.查看公钥

  • cat ~/.ssh/id_rsa.pub

  • 出现提示


    ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDhh2S2F+13yo2KHvLFryn0mRzOVYT1mi2I6rhl45FQ3AcPXgypSuDgKuwVbOu92a+YzA2eXxcUU6qsQG8z1HRchKysSnrbSrj60CfHhsTTfg+vnZVVPjnc+OgUxUtcpQBMg/IyG7ya1c3sDNfToAi7xmu/07yAITot3kEzwctnsi7aCT944t15uoRz8/NokZBGVaqMo9vJj5rSlwzBRdS+gQZJ1gqamcaoLh6/3tHrQ1MYl1jey4kOkvfwyCtUpKDS28GMuO3t2BDhuzBqlpj8SO262pbZ3F3w3lu3Oimjh8M+pU9HMfUIo1zqCvE07XT8t4RVbPxfWSFSPGYG9DL [email protected]


    4.拷贝公钥,添加到你的账号中

    ![20F43117-073C-433F-8671-F07652798191.png](http://upload-images.jianshu.io/upload_images/2056650-8ee2736898d405bb.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

    6.连接到码云

  • ssh -T [email protected]

  • 出现提示
    Welcome to Git@OSC, Wei942!


    恭喜你成功了


    终端图解

    Artboard.png

    你可能感兴趣的:("傻瓜式" Sourcetree怎么提交代码到码云)