git的日常使用

来源:互联网 发布:淘宝网下载2015新版 编辑:程序博客网 时间:2024/04/29 13:44

平时使用git进行版本控制,有一些基本的语句进行记录

$ touch README.md$ git init$ git add .$ git commit -m 'init'$ git remote add origin https://github.com/guanpengchn/Master.git$ git push -u origin master

查看版本以及版本回退

$ git log$ git log --pretty=oneline3628164fb26d48395383f8f31179f24e0882e1e0 append GPLea34578d5496d7dd233c827ed32a8cd576c5ee85 add distributedcb926e7ea50ad11b8f9e909c05226233bf755030 wrote a readme file$ git reset --hard ea34578$ git show 3628164$ git diff$ git reflogea34578 HEAD@{0}: reset: moving to HEAD^3628164 HEAD@{1}: commit: append GPLea34578 HEAD@{2}: commit: add distributedcb926e7 HEAD@{3}: commit (initial): wrote a readme file$ git git reset --hard 3628164
0 0
原创粉丝点击