Git - 最简单的方法,如果我有沙,就可以看到以前版本的差异 [英] Git - easiest way to see diff with previous version if I have the sha

查看:83
本文介绍了Git - 最简单的方法,如果我有沙,就可以看到以前版本的差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的一位同事检查了Git的一些变化,我想看看这些变化是什么。换句话说,他的签入和它的父母之间的差异。

我觉得合乎逻辑的是运行这个命令:

  git diff shaOfHisCheckIn 

没有工作。它似乎显示了该SHA和我当前工作副本之间的差异。



正确的命令显示给定的SHA与其父项之间的差异是什么?

解决方案

$ b> git show 是你的朋友: $ b

  git show shaOfHisCheckIn 


A colleague of mine checked in some changes to Git, and I want to see exactly what those changes were. In other words, the diff between his check-in and its parent.

What seemed logical to me was to run this command:

git diff shaOfHisCheckIn

But this didn't work. It appears to show the diff between that SHA and my current working copy.

What's the correct command to show the diff between a given SHA and its parent?

解决方案

git show is your friend:

git show shaOfHisCheckIn

这篇关于Git - 最简单的方法,如果我有沙,就可以看到以前版本的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆