git status
// 结果
On branch bthss_V3.0.4
Changes not staged for commit:(use "git add <file>..." to update what will be committed)(use "git checkout -- <file>..." to discard changes in working directory)
modified: ReleaseNote.txt
Untracked files:(use "git add <file>..." to include in what will be committed)
test.txt
no changes added to commit (use "git add" and/or "git commit -a")
查看单个文件状态
git status <file>
git status test.txt
On branch bthss_V3.0.4
Untracked files:(use "git add <file>..." to include in what will be committed)
test.txt
nothing added to commit but untracked files present (use "git add" to track)
提交文件
git add:添加文件到暂存区
git add // 默认添加所有
git add <file>// 添加单个文件
git add -A // 表示添加所有内容
git add .// 表示添加新文件和编辑过的文件不包括删除的文件
git add u // 表示添加编辑或者删除的文件,不包括新添加的文件
git add -A .// 一次添加所有改变的文件
git commit:提交文件到本地库
git commit
git commit <file>
git commit -m "message"// -m 指定提交时的注释,上面两种会打开vim编辑器来编辑提交注释
git commit -a -m "massage"// -a 跳过git add添加到暂存区步骤就可以提交