码迷,mamicode.com
首页 > 其他好文 > 详细

[Practical Git] Compare file changes with git diff

时间:2016-08-12 06:40:00      阅读:157      评论:0      收藏:0      [点我收藏+]

标签:

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

标签:

原文地址:http://www.cnblogs.com/Answer1215/p/5763450.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!