命令格式

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. HDU/杭电2013多校第三场解题报告

    今天悲剧了,各种被虐啊,还是太年轻了 Crime 这道题目给的时间好长,第一次就想到了暴力,结果华丽丽的TLE了. 后来找了一下,发现前24个是1, 2, 6, 12, 72, 72, 864, 17 ...

  2. node-webkit

    最近迷上了node-webkit工程.准备搜集并整理一些东西放在这里

  3. Python 结巴分词模块

    原文链接:http://www.gowhich.com/blog/147?utm_source=tuicool&utm_medium=referral PS:结巴分词支持Python3 源码下 ...

  4. mysql 找不到或无法加载已注册的 .Net Framework Data Provider

    需要安装 mysql-connector-net-6.7.4.msi 在C盘安装mysql的位置找到三个DLL,复制到Bin文件夹下 在C:\Windows\Microsoft.NET\Framewo ...

  5. 在VS2012下不安装VS2010编译VS2010的工程

    虽然一路追随这VISUAL SUTDIO在编程,但是断档的情况还是有的,最近一次硬盘问题使得安装了所有的VS2003-VS2012的机器硬盘挂了,无奈只能够安装了,不过觉得没啥用了,就安装一个VS20 ...

  6. lightOJ 1030(期望)

    题意:有一个迷宫是1×n的格子,一个人每到一个格子就能够把这个格子内的金子所有拿走,刚開始站在第1个格子,然后開始掷骰子得到点数x,他就要从当前位置走到加x的位置.假设发现位置是大于n的就又一次掷骰子 ...

  7. delphi 中DLL的建立

    Dll的创建与调用   File ->New->Other->Dll Wizard  DLL的创建 //可以将本代码复制粘贴到项目中 library Project1; uses S ...

  8. WWDC2015

     

  9. pt-online-schema-change使用说明、限制与比较

    http://seanlook.com/2016/05/27/mysql-pt-online-schema-change/ http://blog.itpub.net/22664653/viewspa ...

  10. SHELL 详解

    http://blog.csdn.net/vah101/article/details/6173488 ( a=2;b=4;c=9; ) 子shell 环境 { a=2;b=4;c=9; } 当前sh ...