git status的用法
git status 用于查看工作区与暂存区的已tracked及untracked的所有文件status.
以下为help结果。
git help status
NAME
git-status - Show the working tree status
DESCRIPTION
Displays paths that have differences between the index file and the current HEAD commit, paths that have differences between the working tree and the index file, and paths in the working tree that are not tracked by Git (and are not ignored by gitignore(5)). The first are what you would commit by running git commit
; the second and third are what you couldcommit by running git add before running git commit
.
执行status前我做了哪些动作,
1、修改了1.txt并执行git add 1.txt
2、修改了2.txt,无其他操作
3、新增了3.txt文件,无其他操作
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage) modified: .txt
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: .txt Untracked files:
(use "git add <file>..." to include in what will be committed) .txt
Changes to be committed: 表示 tracked & modified % in stage waiting for commit 的文件
Changes not staged for commit:表示 tracked & modified & not in stage 的文件
Untracked files:表示 untracked 文件
通过git add 之后,文件都处于 in stage 状态,changes to be commited。
等待提交。
$ git add . $ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage) modified: .txt
modified: .txt
new file: .txt
要注意区分各个状态间的差异!
最新文章
- Fiddler-2 Fiddler抓包原理
- MyScript 手写识别数学公式、图形 自动计算
- 六间房 繁星 酷我 来疯 秀吧 新浪秀 直播播放器 Live 1.2
- C# 文件读写FileInfo
- 图像特征提取三大法宝:HOG特征,LBP特征,Haar特征(转载)
- CentOS 编译安装Apache2.4.10
- PHP代码为什么不能直接保存HTML文件——&;gt;PHP生成静态页面教程
- 使用mailto在网页中链接Email地址
- hdu 5493 Queue(线段树)
- PHP数组与对象之间用递归转换
- C# - 重写虚方法
- HTML5学习系列之表单与文件
- python3 实例方法、类方法和静态方法
- iReport 5.6.0 组件面板为空 get小技巧
- python中序列化模块json和pickle
- DFS CCPC2017 南宁I题
- Codeforces Round #189 (Div. 1) C - Kalila and Dimna in the Logging Industry 斜率优化dp
- Linux Performance Analysis and Tools(Linux性能分析和工具)
- react篇章-React State(状态)
- ctf实验平台-成绩单