软件版本:
操作系统:ubuntu10.04
内核版本:Linux version 2.6.32-36-generic
git 版本:git version 1.7.0.4
目录:
1. 文件状态
2. 提交
2.1 git commit 与 git commit -a
2.2 添加提交信息
3. 修改/取消
4. 参考资料
1. 文件状态
一般仓库中的文件可能存在于这三种状态:
1)Untracked files → 文件未被跟踪;
2)Changes to be committed → 文件已暂存,这是下次提交的内容;
3) Changes bu not updated → 文件被修改,但并没有添加到暂存区。如果 commit 时没有带 -a 选项,这个状态下的文件不会被提交。
$git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD ..." to unstage)
#
# new file: file2
#
# Changed but not updated:
# (use "git add ..." to update what will be committed)
# (use "git checkout -- ..." to discard changes in working directory)
#