1
2
3
4
5
6
7
8
9
10
11
12
13
git init //在当前目录新建一个Git代码库

git add . // 添加改动文件到暂存区

git rm --cached [file] //停止追踪指定文件,但该文件会保留在工作区(如果添加ignorance文件无效的话)

git commit -m [message] //提交暂存区到仓库区

git checkout . // 恢复暂存区的所有文件到工作区

// 暂时将未提交的变化移除,稍后再移入
git stash
git stash pop