Win10下Git的设置

作者: SolBeiker | 来源:发表于2019-11-08 22:36 被阅读0次

    环境准备

    实施步骤

    打开Git bash

    开始菜单 -> Git -> Git Bash

    生成证书

    ssh-keygen -t rsa -C “your emial@xxx.com”
    

    复制证书

    在C盘当前用户目录中.ssh文件夹,找到 id_rsa.pub文件,使用记事本打开并复制其中内容

    进入设置

    在Github个人页面,选择Settings,并进入SSH and GPG keys 选项 https://github.com/settings/keys,选择new ssh key

    粘贴证书

    将步骤3中复制的内容粘贴入打开输入框中,并保存

    连接测试

    在Git bash中输入

    ssh -T git@github.com
    

    出现如下字样即为成功

    You've successfully authenticated

    全局设置

    git config --global user.name  “your name”
    git config --global user.email "your email@xxx.com"
    

    正常使用

    进入项目目录

    git init
    git add -A
    git commit -m "1st commit"
    git remote add origin git@github.com:UserName/RepertoryName.git
    git push -u origin master

    相关文章

      网友评论

        本文标题:Win10下Git的设置

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