git代码管理工具安装使用过程

0.前言

从官网https://git-scm.com/download/win下载即可,一路默认点击下一步即可

1.ssh文件生成

打开git控制命令台,在安装的路径中找到git-Bash.exe,启动之。

输入命令如下:

ssh-keygen -t rsa -C "[email protected]"

并连续敲 3 次回车即可.

秘钥生成,显示信息如下:

Your identification has been saved in /c/Users/x/.ssh/id_rsa.

Your public key has been saved in /c/Users/x/.ssh/id_rsa.pub.

2.配置ssh

在GitHub官网上登录之,点击自己头像,选择设置,然后选择"SSH and GPG keys",点击"New SSH key" 按钮进行配置。title可以随意设置,而key的值即是之前生成的ssh文件的内容,复制过来,然后确定即可。

3.验证是否配置成功

输入命令如下:

$ ssh -T [email protected]
The authenticity of host 'github.com (52.74.223.119)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,52.74.223.119' (RSA) to the list of known hosts.

Hi x! You've successfully authenticated, but GitHub does not provide shell access.

配置成功。

4. 推送本地文件到远程端

使用命令如下:

git add README

git commit -m "first commit"

git push origin master

完成推送

你可能感兴趣的:(编程工具使用记录)