Git学习笔记

Git工作区和暂存区视图:

初始化:
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
posted @ 2016-06-08 11:13  Fres  阅读(129)  评论(0编辑  收藏  举报