命令格式

git commit [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend]
      [--dry-run] [(-c | -C | --fixup | --squash) <commit>]
      [-F <file> | -m <msg>] [--reset-author] [--allow-empty]
      [--allow-empty-message] [--no-verify] [-e] [--author=<author>]
      [--date=<date>] [--cleanup=<mode>] [--[no-]status]
      [-i | -o] [-S[<keyid>]] [--] [<file>…​]

命令参数

-a, --all
  直接将工作区的修改提交至仓库。

实例

a) 将暂存区的提交至仓库

[huey@huey-K42JE hello_git]$ date > datetime.txt
[huey@huey-K42JE hello_git]$ git add .
[huey@huey-K42JE hello_git]$ git commit -m "change datetime"
[master 7983be4] change datetime
1 files changed, 1 insertions(+), 1 deletions(-)

b) 直接将工作区的修改提交至仓库

[huey@huey-K42JE hello_git]$ rm datetime.txt
[huey@huey-K42JE hello_git]$ date > datetime.txt
[huey@huey-K42JE hello_git]$ git commit -a -m "rm testfile & change datetime"
[master 5622ecb] rm testfile & change datetime
2 files changed, 1 insertions(+), 2 deletions(-)
delete mode 100644 testfile.txt

更多

http://git-scm.com/docs/git-commit

Git CMD - add: Record changes to the repository的更多相关文章

  1. Git CMD - add: Add file contents to the index

    命令格式 git add [--verbose | -v] [--dry-run | -n] [--force | -f] [--interactive | -i] [--patch | -p] [- ...

  2. Git CMD连接,管理(remote,add,commit,push)github repository

    git initmd testcd testgit statusgit add test  //git add test/a.txtgit status git remote add origin g ...

  3. git remote add origin错误

    如果输入$ Git remote add origin git@github.com:djqiang(github帐号名)/gitdemo(项目名).git 提示出错信息:fatal: remote ...

  4. Difference between git remote add and git clone

    http://stackoverflow.com/questions/4855561/difference-between-git-remote-add-and-git-clone git remot ...

  5. [git 学习篇] git remote add origin错误

    http://blog.csdn.net/dengjianqiang2011/article/details/9260435 如果输入$ Git remote add origin git@githu ...

  6. Git CMD - remote: Manage set of tracked repositories

    命令格式 git remote [-v | --verbose] git remote add [-t <branch>] [-m <master>] [-f] [--[no- ...

  7. Git学习篇之git remote add origin错误

    提示出错信息:fatal: remote origin already exists. 解决办法如下: 1.先输入$ git remote rm origin 2.再输入$ git remote ad ...

  8. git cmd 命令在已有的仓库重新添加新的文件夹

    正确步骤: 1. git init //初始化仓库 git add .(文件name) //添加文件到本地仓库 git commit -m “first commit” //添加文件描述信息 git ...

  9. OpenStack git cmd

    文件流转的三个工作区域:Git 的工作目录,暂存区域,以及本地仓库. 基本的 Git 工作流程如下: 在工作目录中修改某些文件. 对修改后的文件进行快照,然后保存到暂存区域. 提交更新,将保存在暂存区 ...

随机推荐

  1. UVa 11971 Polygon (数学,转化)

    题意:一根长度为n的木条,随机选k个位置将其切成k+1段,问这k+1段能组成k+1条边的多边形的概率. 析:这个题,很明显和 n 是没有任何关系的,因为无论 n 是多少那切多少段都可以,只与切多少段有 ...

  2. VBA在Excel中的应用(一):改变符合条件单元格的背景颜色

    在使用excel处理数据的时候,为了能更清晰的标示出满足特定条件的单元格,对单元格添加背景色是不错的选择.手工处理的方式简单快捷,但是当遇到大批量数据,就会特别的费时费力,而且不讨好(容易出错).通过 ...

  3. 下载Xml文件方法

    #region 下载Xml文件方法 //定义委托 private delegate void DownLoadDelegate(string url, string filename); privat ...

  4. rsync服务架设(数据同步|文件增量备份)

        近期由于业务需要,需要将两台服务器数据保持同步.方案有很多,rsync是其中一种解决方案,本文对rsync的安装及配置进行简单说明,其他实现方式有兴趣可以研究.以下是本文提纲,供参考: rsy ...

  5. 【M8】了解各种不同意义的new和delete

    1.首先考虑new operator,new operator 可以认为做了三件事情:a.调用operator new分配一块内存:b.在这块内存上调用构造方法构造对象:返回指针. 2.operato ...

  6. Swift学习笔记三

    协议和扩展 在Objective-C中,协议是很常见也非常重要的一个特性,Swift中也保留了协议,语法略有变化. 用protocol关键字声明一个协议: protocol ExampleProtoc ...

  7. Codeforces Round #318 [RussianCodeCup Thanks-Round] (Div. 1) B. Bear and Blocks 水题

    B. Bear and Blocks Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/573/pr ...

  8. MyBatis之六:缓存

    MyBatis 3中的缓存实现的很多改进都已经实现了,使得它更加强大而且易于配置.默认情况下是没有开启缓存的,除了局部的session缓存,可以增强变现而且处理循环依赖也是必须的.要开启二级缓存,你需 ...

  9. 更新mac自带的python

    mac lion自带的python是2.7版本的,有点儿低,要使用一些应用的时候还需要3.3以上的,这时可以用以下的方法更新mac自带的python. 先去python的官网下载最新的python,并 ...

  10. MySQL 高可用MHA安装部署以及故障转移详细资料汇总 转

    http://blog.itpub.net/26230597/cid-87082-list-2/ 1,简介 .1mha简介 MHA,即MasterHigh Availability Manager a ...