美文网首页Ubuntu使用
Ubuntu下git的安装、github的连接

Ubuntu下git的安装、github的连接

作者: Lauracal | 来源:发表于2019-03-23 18:35 被阅读0次

    1、确认系统是否已经安装git,输入命令:

    git
    

    2、若系统未安装git,使用下面的命令安装:

    sudo apt-get install git
    

    3、配置用户名和邮箱:

    git config --global user.name "你的名字"
    git config --global user.email "你的邮箱"
    

    4、创建密钥:

    ssh-keygen -C '你的邮箱' -t rsa
    

    提示输入内容都可以为空,密钥文件默认路径为~/.ssh/id_rsa.pub
    5、复制id_rsa.pub中的内容。
    6、打开github,依次选择Settings -> SSH and GPG keys -> New SSH Key,Title可以随便写,Key粘贴上面复制的内容。
    7、验证是否连接成功:

    ssh -T git@github.com
    

    相关文章

      网友评论

        本文标题:Ubuntu下git的安装、github的连接

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