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

要注意区分各个状态间的差异!

git status的用法的更多相关文章

  1. [译]git status

    git status git status命令能展示工作目录和stage区的状态. 使用他你能看到那些修改被staged到了, 哪些没有, 哪些文件没有被Git tracked到. git statu ...

  2. Git 安装及用法 github 代码发布 gitlab私有仓库的搭建

    版本控制是一种记录一个或若干文件内容变化,以便将来查阅特定版本修订情况的系统. 这个版本控制软件,有 svn还有git,是一个工具. git是由linux的作者开发的 git是一个分布式版本控制系统 ...

  3. git的基本用法——我的日常使用

    git的基本用法 一,前言 网上有太多关于git的用法说明,而我看得云里雾里,可能是本人比较愚笨.平常时间老问别人又觉得很不好意思,估计大多的同学们都是自己解决.后来我想到了买一本书,淘宝上git书籍 ...

  4. git日常基本用法

    git作为项目管理现在已经是越来越广泛应用,结合自己平时的一些基本操作加上git说明文档里面的一些补充,我总结了一下git的基本用法: mkdir project # 创建项目目录 cd projec ...

  5. GIT配置及用法

    ssh配置 TortoiseGit配置 用法: 下面是我整理的常用 Git 命令清单.几个专用名词的译名如下. Workspace:工作区 Index / Stage:暂存区 Repository:仓 ...

  6. Git超详细用法,通俗易懂

    创建本地仓库 和 远端共享仓库 直接下载安装包:Git下载地址 安装 git,查看 git 版本,git version 配置项目的 git 账号 git config --global user.n ...

  7. 使用git status快速commit

    提交之前使用git status可以看到将要提交的文件,如果想部分提交,需要单独commit.使用下面这句可以快速commit git commit `git status | grep 'mod' ...

  8. git status message - Your branch is ahead of origin/master by X commits

    git reset --hard origin/master git status FAQ: When I issue the "git status" command, I se ...

  9. git status 不可全信

    不要相信git status,除非在操作的过程中, 看git仓库和本地.git之间的差异 -比如我现在在github上某个分支下上传了某个文件,但我在本地git status显示的还是working ...

随机推荐

  1. 微信 公众号平台 与 开放平台 获取用户信息 scope snsapi_login

    微信公众号(公众平台) 和 微信开放平台 是两码事.公众号(公众平台)获取的scope只包括两种:snsapi_base 和snsapi_userinfo,前者是静默获取,用户无感知:后者是需要用户确 ...

  2. 如何批量下载网站中的超链接(一次性下载网页中所有可能的PDF文件)

    最近公司在做工程项目,实现文件批量下载. 网上找了很久,发现网上的代码都有相似的问题,不过最终还是让我找到了一个符合的项目. 工程: 进行项目文件下载功能分析,弄清楚文件批量下载的原理,提供的数据支持 ...

  3. ORA-06553: PLS-553: character set name is not recognized, while starting Content Store

    Symptom CM-CFG-5029 Content Manager is unable to determine whether the content store is initialized. ...

  4. WebGIS博客文本分析(词频分析)手动扒取 去除格式 词语分割 统计分析

    1.      [置顶](一)开篇—杂谈WebGIS 摘要: 文章版权由作者李晓晖和博客园共有,若转载请于明显处标明出处:http://www.cnblogs.com/naaoveGIS/ 1.前言 ...

  5. ubuntu 开机自启(2B的经历)

    上午写了很细致的开机自启说明文档(需打开terminal进行输出认证).睡了一下午,回来楼主说,联想PM要用Ubuntu Server 当服务器,必须用命令行实现.. 连续各种百度谷歌,看了N多文档, ...

  6. Hdu1083 Courses

    Courses Problem Description Consider a group of N students and P courses. Each student visits zero, ...

  7. nutch从搜索引擎到网络爬虫

    人物介绍 姓名:DougCutting 个人名望:开发出开源全文检索引擎工具包Lucene. 个人简介/主要荣誉:除了 Lucene,还开发了著名的网络爬虫工具 Nutch,分布式系统基础架构Hado ...

  8. js五道经典练习题--第一道

    <!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title>& ...

  9. 深入探讨 Java 类加载器(转)

    原帖地址:https://www.ibm.com/developerworks/cn/java/j-lo-classloader/ 类加载器是 Java 语言的一个创新,也是 Java 语言流行的重要 ...

  10. 背水一战 Windows 10 (56) - 控件(集合类): ListViewBase - 基础知识, 拖动项

    [源码下载] 背水一战 Windows 10 (56) - 控件(集合类): ListViewBase - 基础知识, 拖动项 作者:webabcd 介绍背水一战 Windows 10 之 控件(集合 ...