Git学习笔记
Git工作区和暂存区视图:
![](https://images2015.cnblogs.com/blog/974403/201606/974403-20160608111151324-1162485578.jpg)
初始化:
$ git config --global user.name "Your Name"
$ git config --global user.email "email@example.com"
初始化仓库:
$ git init
常用命令:
$ git add FileName/FloderName //添加文件或目录到暂存区
$ git status //查看状态
$ git commit -m "备注" //将暂存区文件提交到当前分支
Git与GitHub的运用:
创建SSH密钥:
$ ssh-keygen -t rsa -C "youremail@example.com" //生成
id_rsa.pub文件存放公有密钥 关联GitHub仓库:
$ git remote add origin git@github.com:michaelliao/learngit.git
推送本地文件到GitHub仓库
$ git push -u origin master