GitGit使用

Git

2017-02-23  本文已影响0人  JackyBA

ref: 工作区和暂存区

工作区 暂存区 版本库

Git远程库版本回滚

撤销修改:

命令 含义
$ git config --global user.name "Your Name"
$ git config --global user.email "email@example.com"
$ git checkout -- <file> 撤销工作区的修改
$ git reset HEAD <file> 撤销(unstage) 暂存区的修改, 重新放回工作区
$ git reset --hard <commit_id>
$ git log 提交(Commit) 历史
$ git reflog 命令历史
$ git config --global alias.logx "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" 配置查看提交历史命令别名
$ git stash branch <branch_name> 从储藏中创建分支

取消储藏(Un-applying a Stash)

$ git config --global alias.stash-unapply '!git stash show -p | git apply -R' ```

```shell
$ git config --global alias.logx "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" 
上一篇 下一篇

猜你喜欢

热点阅读