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. 更改nginx默认的网页目录

    默认网站根目录为/usr/local/nginx/html,要将它改成/homw/www vi /usr/local/nginx/conf/nginx.conf 将其中的           loca ...

  2. apache开源项目--ZooKeeper

    ZooKeeper是Hadoop的正式子项目,它是一个针对大型分布式系统的可靠协调系统,提供的功能包括:配置维护.名字服务.分布式同步.组服务等.ZooKeeper的目标就是封装好复杂易出错的关键服务 ...

  3. WCF发布后远程访问的域名解析问题

    环境: VS2010 sp1,.net framework 4.0,windows server 2003 x64 ,iis 6.0 症状: WCF开发测试,本地调用都正常.发布后,在浏览器中访问ht ...

  4. 【转】ubuntu下自动挂载硬盘分区

    1, 首先摸清我系统的硬盘分区等使用情况 sudo fdisk -l Disk /dev/sda: 128.0 GB, 128035676160 bytes 255 heads, 63 sectors ...

  5. POJ3281 Dining 最大流

    题意:有f种菜,d种饮品,每个牛有喜欢的一些菜和饮品,每种菜只能被选一次,饮品一样,问最多能使多少头牛享受自己喜欢的饮品和菜 分析:建边的时候,把牛拆成两个点,出和入 1,源点向每种菜流量为1 2,每 ...

  6. Python脚本控制的WebDriver 常用操作 <二十三> wait

    测试用例场景 Wait类的使用场景是在页面上进行某些操作,然后页面上就会出现或隐藏一些元素,此时使用Wait类的until方法来等待这些效果完成以便进行后续的操作.另外页面加载时有可能会执行一些aja ...

  7. HW7.10

    public class Solution { public static void main(String[] args) { int[][] array = new int[3][3]; for( ...

  8. 洛谷 P1169 [ZJOI2007]棋盘制作

    2016-05-31 14:56:17 题目链接: 洛谷 P1169 [ZJOI2007]棋盘制作 题目大意: 给定一块矩形,求出满足棋盘式黑白间隔的最大矩形大小和最大正方形大小 解法: 神犇王知昆的 ...

  9. Linux下用hostapd架无线AP

    Published by 荒野无灯 on 2011-10-08 00:56:02 under 服务器/MySQL Tags: 路由,无线AP,hostapd 34452 views 本文将介绍在lin ...

  10. HDU 5710 Digit-Sum (构造)

    题意: 定义S(N) 为数字N每个位上数字的和.在给两个数a,b,求最小的正整数n,使得 a×S(n)=b×S(2n). 官方题解: 这道题目的结果可能非常大,所以我们直接枚举n是要GG的. 首先可以 ...