git diff 等同于 git diff HEAD

jiqing@ubuntu:/home/wwwroot/default/siemens/new_hotel$ git diff HEAD
diff --git a/Index/Lib/Action/GetDataAction.class.php b/Index/Lib/Action/GetDataAction.class.php
index 1550a57..0f79846 100644
--- a/Index/Lib/Action/GetDataAction.class.php
+++ b/Index/Lib/Action/GetDataAction.class.php
@@ -60,8 +60,16 @@ class GetDataAction extends Action{
} /**
- * 获取统计数据
- *
+ * 统计数据展示
+ * 1 点我制作
+ * 2 开始
+ * 3 马上拍照
+ * 4 上一步
+ * 5 生成
+ * 6 重做
+ * 7 分享
+ * 8 ~ 26 (7 + i) 19个贴纸的点击,i为贴纸的id
+ * 27 ~ 45 ( 26 + i) 19个贴纸的使用,i为贴纸的id
*/

具体的某个版本与版本之间可以比较

jiqing@ubuntu:/home/wwwroot/default/siemens/new_hotel$ git diff HEAD^ HEAD^^
diff --git a/Index/Lib/Action/GetDataAction.class.php b/Index/Lib/Action/GetDataAction.class.php
index 1550a57..d997bcd 100644
--- a/Index/Lib/Action/GetDataAction.class.php
+++ b/Index/Lib/Action/GetDataAction.class.php
@@ -17,8 +17,9 @@ class GetDataAction extends Action{
* 5 生成
* 6 重做
* 7 分享
- * 8 ~ 26 (7 + i) 19个贴纸的点击,i为贴纸的id
- * 27 ~ 45 ( 26 + i) 19个贴纸的使用,i为贴纸的id
+ * 8 点我制作
+ * 9 ~ 27 (8 + i) 19个贴纸的点击,i为贴纸的id
+ * 28 ~ 46 ( 27 + i) 19个贴纸的使用,i为贴纸的id
*/
public function get_data(){
if(trim($_POST['type'])){
@@ -58,15 +59,4 @@ class GetDataAction extends Action{
send_http_status(200);
}
}

前后顺序无所谓

jiqing@ubuntu:/home/wwwroot/default/siemens/new_hotel$ git diff HEAD^^ HEAD^
diff --git a/Index/Lib/Action/GetDataAction.class.php b/Index/Lib/Action/GetDataAction.class.php
index d997bcd..1550a57 100644
--- a/Index/Lib/Action/GetDataAction.class.php
+++ b/Index/Lib/Action/GetDataAction.class.php
@@ -17,9 +17,8 @@ class GetDataAction extends Action{
* 5 生成
* 6 重做
* 7 分享
- * 8 点我制作
- * 9 ~ 27 (8 + i) 19个贴纸的点击,i为贴纸的id
- * 28 ~ 46 ( 27 + i) 19个贴纸的使用,i为贴纸的id
+ * 8 ~ 26 (7 + i) 19个贴纸的点击,i为贴纸的id
+ * 27 ~ 45 ( 26 + i) 19个贴纸的使用,i为贴纸的id
*/
public function get_data(){
if(trim($_POST['type'])){
@@ -59,4 +58,15 @@ class GetDataAction extends Action{
send_http_status(200);
}
}

git diff 分支1 分之2

看详细差异

jiqing@ubuntu:/home/wwwroot/default/siemens/new_hotel$ git diff siemens master
diff --git a/.gitignore b/.gitignore
index 8f32300..6655344 100755
--- a/.gitignore
+++ b/.gitignore
@@ -49,8 +49,6 @@ Shop/Runtime
*/*~
Public/Public
Public/upload/bgimg/*
-Public/log/*
-Public/tmp/*
!Public/upload/bgimg/.tmp .settings/
diff --git a/Index/Conf/config.php b/Index/Conf/config.php
index 4fd4d44..3124482 100644
--- a/Index/Conf/config.php
+++ b/Index/Conf/config.php
@@ -1,13 +1,4 @@

git diff 分支1 分之2 --stat

看大局差异

jiqing@ubuntu:/home/wwwroot/default/siemens/new_hotel$ git diff siemens master --stat
.gitignore | 2 -
Index/Conf/config.php | 21 +-
Index/Lib/Action/CommonAction.class.php | 61 +--
Index/Lib/Action/GetDataAction.class.php | 72 ---
Index/Lib/Action/SiemensAction.class.php | 715 ----------------------------
Index/Tpl/Circus/index.html | 3 +-
Index/Tpl/Siemens/index.html | 327 -------------
Index/Tpl/Siemens/share.html | 54 ---
Public/MP_verify_HIkhmwma5QBj98ns.txt | 1 -
Public/index.php | 4 +-
Public/siemens/css/.font-spider/PingFang ExtraLight.ttf | Bin 11035472 -> 0 bytes
Public/siemens/css/.font-spider/wryh.ttf | Bin 15043584 -> 0 bytes
Public/siemens/css/animate.css | 3279 -------------------------------------------------------------------------------------------------------------------------------
Public/siemens/css/animate.min.css | 6 -
Public/siemens/css/index.css | 605 ------------------------
Public/siemens/css/index.scss | 540 ---------------------
Public/siemens/css/reset.min.css | 2 -
Public/siemens/css/swiper.min.css | 15 -
Public/siemens/css/zepto.plugin.css | 87 ----
Public/siemens/css/zepto.plugin.scss | 87 ----
Public/siemens/font/msyh.ttf | Bin 21767952 -> 0 bytes

还可以进行本地分支与线上分支的比较

jiqing@ubuntu:/home/wwwroot/default/5hao/sheep-doc$ git diff origin/5hao
diff --git a/cart.md b/cart.md
index 0174a54..b2861b3 100644
--- a/cart.md
+++ b/cart.md
@@ -80,7 +80,6 @@ uid 有则传,无则不传
"name": "法兰西苹果",
"has_activity": 0,
"id": "1", // 商品id
- "type":"1", //type:1.自营商品;2.积分好货
"collection" : 1
"is_relation_attr": [
{
@@ -111,7 +110,6 @@ uid 有则传,无则不传
"has_activity": 0,
"collection" : 1
"id": "2",
- "type":"2", //type:1.自营商品;2.积分好货
"is_relation_attr": [
{
"name": "产地",

默认拿当前本地版本对比线上的最新版本。

如果有一段时间,没有更新,则需要处理一下,才能对比出最新的代码。

git fetch origin
git diff yanglu origin/gaodian

或者只看文件

git diff yanglu origin/gaodian --stat

git diff比较使用的更多相关文章

  1. git diff 生成patch, git apply patch 打补丁方法说明,以及分支管理的简单操作。

    git diff 简易操作说明 先git log 查看commit ID, 记录你想要打的补丁的ID 比如说: git log commit 4ff35d800fa62123a28b7bda2a04e ...

  2. Saving the entire git diff between two commits in a text file

    git diff A10..A1 > my.diff 转自: http://stackoverflow.com/questions/19067896/saving-the-entire-git- ...

  3. git diff ^M的消除

    这是由于换行符在不同的操作系统上定义的区别造成的. Windows用CR LF来定义换行,Linux用LF. CR全称是Carriage Return ,或者表示为\r, 意思是回车. LF全称是Li ...

  4. 基于git diff进行的eslint代码检测

    缘起 在项目中, 通常都会使用代码检测工具来规范团队的代码风格, 比如eslint.随着代码的不断增加, eslint进行代码检测的时间也越来越久.每次检测的时候, 需要检测的文件和实际检测的文件极度 ...

  5. git diff提示filemode发生改变(old mode 100644、new mode 10075)

    今天clone代码,git status显示修改了大量文件,git diff提示filemode变化,如下: diff --git a/Android.mk b/Android.mkold mode ...

  6. git diff的用法

    在git提交环节,存在三大部分:working tree(工作区), index file(暂存区:stage), commit(分支:master) working tree:就是你所工作在的目录, ...

  7. git diff

    git diff  工作区与暂存区的差别 git diff -cached / git diff -staged  暂存区与版本库的差别 git diff HEAD  工作区与版本库的差别 git d ...

  8. git diff获取差异文件中文乱码的解决办法

    通过git的diff命令对两个commit id的版本进行差异化的对比.中文文件时出现乱码. git diff 6bded8d0c1fe1746c122121217dc0c88667091089 a9 ...

  9. Git diff 常见用法

      Git diff 用于比较两次修改的差异 1.1 比较工作区与暂存区 git diff  比较的是单个仓库的工作区与暂存区的差别,repo diff是对git diff的封装,用来分别显示各个项目 ...

  10. git diff patch

    如何生成patch:修改一个地方,然后git diff > xxx.patch 就会生成一个patch文件,这里的关键似乎是, 源文件的某个模块的版本要和线上发布的最新版本要一致,这样patch ...

随机推荐

  1. MFC_2.1使用单选和多选框

    使用单选和多选框 单选 1.拖控件 设置名字,CTRL+D设置顺序,属性设置第一个GROUP为TRUE: 2.设置第一个按钮绑定变量为 值 INT型 名称m_RadioIndxe; 3.设置单击响应内 ...

  2. 08Java Server Pages 语法

    Java Server Pages 语法 基础语法 注释 <!--   -->可以在客户端通过源代码看到:<%--   --%>在客户端通过查看源代码看不到. <!--浏 ...

  3. enote笔记法的思考

    章节:enote笔记法的思考   why enote笔记法: key1)大脑喜欢颜色. 我们的大脑天生就喜欢颜色.对颜色很敏感,这是由我们人类过去的演化历程决定的. 你可以理解为,文字有了颜色,让这个 ...

  4. plotting and saving over line in paraView

    probe -- provides the field values in a particular location in space To save plotoverline to csv fil ...

  5. extract a page from a multiple pages pdf on Ubuntu OS

    extract a page from a multiple pages pdf 1 extract a page from a multiple pages pdf use pdftk packag ...

  6. Discuz论坛迁移需要修改的3个配置文件

    需要修改的3个地方: \config\config_global.php \config\config_ucenter.php \uc_server\data\config.inc.php

  7. Spring MVC学习总结(12)——Spring MVC集成Swagger时报错{"schemaValidationMessages":[

    在springmvc结合swagger的时候,如果将项目部署到服务器上就会出现问题出现下面的图标: 点开会报错误信息: schemaValidationMessages":[{"l ...

  8. ceph rbd 入门

    1.一个现成的ceph cluster 参考之前写的ceph-deploy 部署ceph cluster 2.配置client与ceph cluster对接 在ceph cluster的管理节点上安装 ...

  9. Oracle 关于几个随机函数sys_guid、dbms_random.random、dbms_random.value(取随机的结果集)

    sys_guid():SYS_GUID (),是Oracle 8i 后提供的函数.SYS_GUID产生并返回一个全球唯一的标识符(原始值)由16个字节组成.更适合多个数据库数据集成时使用(--源自百度 ...

  10. 你的ExcelUtil简单、高效、易扩展吗

    你的ExcelUtil简单.高效.易扩展吗 Author: Dorae Date: 2018年10月23日12:30:15 转载请注明出处 一.背景 最近接到了和Excel导出相关的需求,但是: 项目 ...