zoukankan      html  css  js  c++  java
  • 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:   1.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: 2.txt Untracked files: (use "git add <file>..." to include in what will be committed) 3.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:   1.txt
            modified:   2.txt
            new file:   3.txt

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

  • 相关阅读:
    uni-app调用原生的文件系统管理器(可选取附件上传)
    uni-app图片压缩转base64位 利用递归来实现多张图片压缩
    解释器模式
    外观模型
    装饰模式
    组合模式
    原型模式
    简单工厂模式
    抽象工厂模式
    工厂方法模式
  • 原文地址:https://www.cnblogs.com/wangbaobao/p/7515163.html
Copyright © 2011-2022 走看看