一、添加ssh-key
首先安装git,添加环境变量
1. 进入git bash
$ git config --global user.name "liu"
$ git config --global user.email "liuliuliu@126.com"
$ ssh-keygen -t rsa -C "liuliuliu@126.com"
按3次回车,则密码为空。
2. 在github网站上添加id_rsa.pub里的内容,默认地址C:\Users\user\.ssh
3. 测试之,显示这些内容即添加ssh-key成功
$ ssh git@github.com
The authenticity of host 'github.com (198.19.0.112)' 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,198.19.0.112' (RSA) to the list of known hosts.
PTY allocation request failed on channel 0
Hi liuliuliu! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
(您好,您验证成功,但是GitHub不提供shell访问。连接关闭。)
二、常用命令
cd wd
git clone git@github.com:liuliuliu/liu.git
cd liu
git pull
git status
git add *.*
git commit
git push