Last active
June 27, 2018 13:31
-
-
Save GopherJ/8a3e275266ca5ca80987b4ffa58dae2f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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