GitHub公钥配置
1.检查是否已生成SSH key
在Git Bash中执行cd ~/.ssh命令,如果存在,表明之前生成过,使用ll命令查看

2.生成新的SSH key
命令行中输入ssh-keygen -t rsa -C "your@email.com",引号里输入自己的邮箱,一直按回车

3.登录到GitHub https://github.com/
4.点击右上方选择settings

5.选择SSH and GPG keys

6.新建New SSH Key

7.在命令行中输入cat ~/.ssh/id_rsa.pub,会打印出一串东西

8.将打印出的东西复制到key中

9.GitHub的公钥配置完成

10.检测Github是否配置完成
ssh -T git@github.com

Github本地配置
1. git config --global user.name "lola liu" 引号后面改成你自己的信息
2. git config --global user.email your@example.com 邮箱改成你的。
3. git config --global core.editor vim
本地创建仓库
1.新建仓库

2.填写仓库的名字

3.复制git链接

4.在命令行中输入 git clone git@github.com:XXXXX/hellodemo.git,将文件拷贝到本地


向仓库中添加文件
1.进入到当前目录
cd XXX
2.查看当前文件状态
git status

3.添加文件
git add XXX.xx

4.将文件push到之前创建的仓库中
git push(同步本地更改的仓库到远程)
5.commit说明
git commit -m 'first commit' // 引号里面的内容改成文件的相关信息

网友评论