git-命令

1
2
3
4
5
6
7
8
9
10
11
git  init                            #初始化仓库
git add test.txt #添加文件到暂存区
git commit -m "add red line" #提交到仓库
git reset --hard head^ #回到上一版本
git reset --hard id #回到id版本
git status #检查目录是否有什么更改
git checkout text.txt #恢复和仓库一样的状态
git log #显示当前版本之前的信息
git reflog #显示最近改的信息,可包括版本前
clear #清屏
cat test.txt #显示文件内容