Skip to content

Instantly share code, notes, and snippets.

@GopherJ
Last active June 27, 2018 13:31
Show Gist options
  • Save GopherJ/8a3e275266ca5ca80987b4ffa58dae2f to your computer and use it in GitHub Desktop.
Save GopherJ/8a3e275266ca5ca80987b4ffa58dae2f to your computer and use it in GitHub Desktop.
1. 列举所有远端分支
```
git branch --remote -a
```
2. 查看已经暂存的更改
```
git diff --cached
```
3. 将放入暂存区的修改重新放入工作区
```
git reset HEAD .
```
4. 重置修改(不删除新增文件)
```
git checkout -- .
```
5. 重置修改(删除新增文件)
```
git clean
```
6. 删除版本库文件
```
git rm file.txt
```
7. 恢复被删除的文件
```
git checkout -- file.txt
```
8. 打上标签
```
git tag -a tagName -m tagMsg commitID
```
9. 查看标签
```
git show tagName
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment