码迷,mamicode.com
首页 > 其他好文 > 详细

常见git命令

时间:2017-11-28 21:06:21      阅读:113      评论:0      收藏:0      [点我收藏+]

标签:git   git add   常用命令   git reset   本地   ref   new   har   版本   

常用命令:

添加到暂存区        git add <file>

删除                       git rm <file>

更名                       git mv <old> <new>

查看不同                git diff 

查看日志                git log

查看命令历史         git  reflog          

撤销未提交的文件内容  git check - - <file> 

 (让这个文件回到最近一次git commitgit add时的状态)

回退版本                 git reset - -hard <commit_id>    ( 通过git log 查看到的commit 的id)

回复文件                  git checkout - - XXXX.txt     

把本地库的所有内容推送到远程库    git push –u origin master

常见git命令

标签:git   git add   常用命令   git reset   本地   ref   new   har   版本   

原文地址:http://www.cnblogs.com/hanyu258/p/7911985.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!