git init
//初始化
git config --global user.name "susuizhou"
git config --global user.email "susuizhou@163.com"
ssh-keygen -t rsa -C "susuizhou@163.com"
git add readme.txt //添加文件,提交文件
git commit -m "wrote a readme file" //提交更改,注释说明
git log //显示提交文件版本记录
git reset --hard 7357e2** //回归某个版本
git reflog //查看历史操作记录
git status //查看状态
git checkout -- readme //取出版本
git reset HEAD file可以把暂存区的修改撤销掉(unstage),重新放回工作区
git rm用于删除一个文件
GitHub应用
ssh-keygen -t rsa -C "susuizhou" //创建SSH Key
git remote rm origin
git remote add origin https://github.com/susuizhou/learngit.git //将本地关联到git仓库关联到github上 susuizhou 账户
it push -u origin master //把本地库的内容推送到远程su395
git clone https://github.com/susuizhou/learngit.git //克隆一个仓库
git config --global user.name "susuizhou"
git config --global user.email "susuizhou@163.com"
ssh-keygen -t rsa -C "susuizhou@163.com"
git add readme.txt //添加文件,提交文件
git commit -m "wrote a readme file" //提交更改,注释说明
git log //显示提交文件版本记录
git reset --hard 7357e2** //回归某个版本
git reflog //查看历史操作记录
git status //查看状态
git checkout -- readme //取出版本
git reset HEAD file可以把暂存区的修改撤销掉(unstage),重新放回工作区
git rm用于删除一个文件
GitHub应用
ssh-keygen -t rsa -C "susuizhou" //创建SSH Key
git remote rm origin
git remote add origin https://github.com/susuizhou/learngit.git //将本地关联到git仓库关联到github上 susuizhou 账户
it push -u origin master //把本地库的内容推送到远程su395
git clone https://github.com/susuizhou/learngit.git //克隆一个仓库