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. Windows提高_2.1第一部分:线程

    第一部分:线程 什么是线程? 线程其实可以理解为一段正在执行中的代码,它最少由一个线程内核对象和一个栈组成. 线程之间是没有从属关系的,同一进程下的所有线程都可以访问进程内的所有内容. 主线程其实是创 ...

  2. Windows下编译64位GSL

    GSL (GNU Scientific Library, http://www.gnu.org/software/gsl/)官方并没有提供编译好的Windows版本.首先要保证Windows是64位的 ...

  3. ThinkPHP---thinkphp完善站内信功能

    [一]收件箱 分析 控制器:EmailController.class.php 方法:recBox(全称receive box收件箱) 模板文件:recBox.html 分步操作: 第一步:创建方法r ...

  4. java命令行版的ATM

    import java.util.*;public class Jatm{ static String user = "123"; static String password = ...

  5. LeetCode_16 3SumCloest

    3Sum Closest Given an array nums of n integers and an integer target, find three integers in nums su ...

  6. 洛谷——P3373 【模板】线段树 2&& B 数据结构

    P3373 [模板]线段树 2 题目描述 如题,已知一个数列,你需要进行下面三种操作: 1.将某区间每一个数乘上x 2.将某区间每一个数加上x 3.求出某区间每一个数的和 线段树维护区间乘法 1.如何 ...

  7. linux下Mongodb集群搭建:分片+副本集

    三台服务器 192.168.1.40/41/42 安装包 mongodb-linux-x86_64-amazon2-4.0.1.tgz 服务规划  服务器40  服务器41  服务器42  mongo ...

  8. BZOJ 3747 洛谷 3582 [POI2015]Kinoman

    [题解] 扫描线+线段树. 我们记第i部电影上次出现的位置是$pre[i]$,我们从$1$到$n$扫描,每次区间$(pre[i],i]$加上第i部电影的贡献$w[f[i]]$,区间$[pre[pre[ ...

  9. Entity SQL rules for Wrapped and Unwrapped Results

    Here are some rules to remember for Entity SQL queries: 1.Use SELECT VALUE when projecting more than ...

  10. qscoj Round 1(div 2)

    卿学姐OJ……很休闲啊……? A 分析:枚举/exgcd B 分析:栈模拟 弄个栈模拟配对过程,将能够配对的()位置染色,最后最长的一段染色区间就是答案 C 分析:dp f[i][j]表示前i个物品, ...