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
要注意区分各个状态间的差异!
git status的用法的更多相关文章
- [译]git status
git status git status命令能展示工作目录和stage区的状态. 使用他你能看到那些修改被staged到了, 哪些没有, 哪些文件没有被Git tracked到. git statu ...
- Git 安装及用法 github 代码发布 gitlab私有仓库的搭建
版本控制是一种记录一个或若干文件内容变化,以便将来查阅特定版本修订情况的系统. 这个版本控制软件,有 svn还有git,是一个工具. git是由linux的作者开发的 git是一个分布式版本控制系统 ...
- git的基本用法——我的日常使用
git的基本用法 一,前言 网上有太多关于git的用法说明,而我看得云里雾里,可能是本人比较愚笨.平常时间老问别人又觉得很不好意思,估计大多的同学们都是自己解决.后来我想到了买一本书,淘宝上git书籍 ...
- git日常基本用法
git作为项目管理现在已经是越来越广泛应用,结合自己平时的一些基本操作加上git说明文档里面的一些补充,我总结了一下git的基本用法: mkdir project # 创建项目目录 cd projec ...
- GIT配置及用法
ssh配置 TortoiseGit配置 用法: 下面是我整理的常用 Git 命令清单.几个专用名词的译名如下. Workspace:工作区 Index / Stage:暂存区 Repository:仓 ...
- Git超详细用法,通俗易懂
创建本地仓库 和 远端共享仓库 直接下载安装包:Git下载地址 安装 git,查看 git 版本,git version 配置项目的 git 账号 git config --global user.n ...
- 使用git status快速commit
提交之前使用git status可以看到将要提交的文件,如果想部分提交,需要单独commit.使用下面这句可以快速commit git commit `git status | grep 'mod' ...
- 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 ...
- git status 不可全信
不要相信git status,除非在操作的过程中, 看git仓库和本地.git之间的差异 -比如我现在在github上某个分支下上传了某个文件,但我在本地git status显示的还是working ...
随机推荐
- warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
问题: yum安装软件时候报如下错误: warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOK ...
- FPGA速度等级
转自http://wenku.baidu.com/view/ea793deef8c75fbfc77db263.html?from=rec 最初接触speed grade这个概念时,很是为Altera的 ...
- 【慕课网实战】Spark Streaming实时流处理项目实战笔记四之铭文升级版
铭文一级: 需求二:Agent选型:exec source + memory channel + logger sink# Name the components on this agenta1.so ...
- dom4j 通过 org.dom4j.DocumentFactory 设置命名空间来支持 带namespace 的 xpath
测试文件 test.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http:/ ...
- Java理论学时第三节。课后作业。
如果一个类中既有初始化块,又有构造方法,同时还设定了字段的初始值,谁说了算? 运行结果. 根据我的总结,它们三个的优先级是:构造方法 > 字段初始值 > 初始化块. 当多个类之间有继承关系 ...
- set_error_handler
set_error_handler这个函数的作用是为了防止错误路径泄露 何为错误路径泄露呢? 我们写程序,难免会有问题,而PHP遇到错误时,就会给出出错脚本的位置.行数和原因 有很多人说,这并没有什么 ...
- JAVA本地读取文件,解决中文乱码问题
JAVA本地读取文件出现中文乱码,查阅一个大神的博客做一下记录 import java.io.BufferedInputStream;import java.io.BufferedReader;imp ...
- poj 2488 A Knight's Journey
题目 题意:给出一个国际棋盘的大小 p*q,判断马能否不重复的走过所有格,并记录下其中按字典序排列的第一种路径. 因为要求字典序输出最小,所以按下图是搜索的次序搜素出来的就是最小的. 初始方向数组:i ...
- lis nlogn算法
当前所在位的最长上升子序列只和前面一个字符有关 #include <iostream> #include <algorithm> using namespace std; ]; ...
- codeforce868c
C. Qualification Rounds time limit per test 2 seconds memory limit per test 256 megabytes input stan ...