首页 > 其他 > 详细

[Practical Git] Compare file changes with git diff

时间:2016-08-12 06:38:25      阅读:261      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!