It can be helpful to see the changes between two sets of code; git diff lets us do this by comparing two Git references and outputting the differences between them. In this lesson, we show how to use git diff along with the --stat--cachedHEADorigin/masterfile(s)/dir(s) options.

If you want to see the difference between stagin area with last commit:

git diff --cached

See the all umcommit changes:

git diff HEAD

See the different with branch:

git diff origin/master   //will show all the change which in local but not in remote master

Compare the file with remote branch:

git diff origin/master getRandomNumber.js  // show the difference between local getRandomNumber.js file with remote master branch

[Practical Git] Compare file changes with git diff的更多相关文章

  1. Git在Windows环境下配置Diff以及Merge工具---DiffMerge

    参考出处:http://coding4streetcred.com/blog/post/Configure-DiffMerge-for-Your-Git-DiffTool主要转自:http://blo ...

  2. git 查看对比的方法log diff

    git shortlog 默认情况下,git shortlog 把输出按作者名字排序,但你可以传入 -n 选项来按每个作者提交数量排序. 1.有冲突时可以用 git status查看 2.通过git ...

  3. how to check unsolved conflicts file list in git merge?

    how to check unsolved conflicts file list in git merge?

  4. Git 基础再学习之:git checkout -- file

    首先明白一下基本概念和用法,这段话是从前在看廖雪峰的git教程的时候摘到OneNote的 准备工作: 新建了一个learngit文件夹,在bash中cd进入文件夹,用以下命令创建一个仓库. $ git ...

  5. 如何理解git checkout -- file和git reset HEAD -- file

    http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/001374831943254ee ...

  6. Go丨语言package github.com/Go-SQL-Driver/MySQL: exec: "git": executable file not found in %PATH%解决方法

    Go语言在添加第三方MySQL驱动的时候报错: go: missing Git command. See https://golang.org/s/gogetcmd package github.co ...

  7. Git - 使用命令和P4Merge进行diff

    P4Merge P4Merge是Git的一个第三发Diff和Merge工具(可视化冲突解决工具). 下载地址: https://www.perforce.com/downloads/visual-me ...

  8. [Practical Git] Format commit history with git log arguments

    When running the git log command, we can pass in options as arguments toformat the data shown for ea ...

  9. git 那些事儿 —— 基于 Learn Git Branching

    前言 推荐一个 git 图形化教学网站:Learn Git Branching,这个网站有一个沙盒可以直接在上面模拟 git 的各种操作,操作效果使用图形的方式展示,非常直观.本文可以看作是它的文字版 ...

随机推荐

  1. UVa 1151 (枚举 + MST) Buy or Build

    题意: 平面上有n个点,现在要把它们全部连通起来.现在有q个套餐,如果购买了第i个套餐,则这个套餐中的点全部连通起来.也可以自己单独地建一条边,费用为两点欧几里得距离的平方.求使所有点连通的最小费用. ...

  2. Xcode7下载地址

    XCode 7 7.3.1:https://developer.apple.com/services-account/download?path=/Developer_Tools/Xcode_7.3. ...

  3. 多线程程序设计学习(10)Future pattern

    Future pattern[订单取货模式] 一:Future pattern的参与者--->Client(客户需求)--->Host(蛋糕门店)--->Data(票据和蛋糕的接口) ...

  4. MySQL性能指标及计算方法

    绝大多数MySQL性能指标可以通过以下两种方式获取: (1)mysqladmin 使用mysqladmin extended-status命令获得的MySQL的性能指标,默认为累计值.如果想了解当前状 ...

  5. Android 数据传输之MessagePack使用

    介绍过什么是MessagePack之后,就进行Android与MessagePack的使用. 在MessagePack的官网上介绍MessagePack与Java结合使用的都是使用Maven作为JAR ...

  6. 高质量、处于持续更新的R包

    本文在Creative Commons许可证下发布 自由软件的问题是开发人员没有稳定的资金来源支持,可能更新上做不到持续.经过考证和圈内朋友的帮助,现在把R包中高质量.持续更新的跟大数据事业相关的R包 ...

  7. linux内核-红黑树

    //rbtree.h /*   Red Black Trees   (C) 1999  Andrea Arcangeli <andrea@suse.de>     This program ...

  8. jqgrid在页面出来竖型滚动条自动调整列宽

    在项目中使用jqgrid的时候,需要设置在页面竖型滚动条出来的时候,列宽进行调整 1. 判断jqgrid的宽度是否和页面的宽度不一致(判断滚动条是否出来) 2. 调整jqgrid的列宽,因为jqgri ...

  9. 44 个 JavaScript 变态题解析

    当初笔者做这套题的时候不仅怀疑智商, 连人生都开始怀疑了…. 不过, 对于基础知识的理解是深入编程的前提. 让我们一起来看看这些变态题到底变态不变态吧! 第1题 ["1", &qu ...

  10. Java中万恶的注解

    本文由码农网 – 孙腾浩原创翻译,转载请看清文末的转载要求,欢迎参与我们的付费投稿计划! 当Java 1.5引入注解,企业开发者对简化EJB和其他企业产品开发抱有很大期望.可以看一看同一时期的一篇文章 ...