将文件的当前工作副本与另一个分支的提交副本进行比较 [英] diff current working copy of a file with another branch's committed copy

查看:127
本文介绍了将文件的当前工作副本与另一个分支的提交副本进行比较的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在master分支中有一个包含 foo 的文件。我切换到栏分支并对 foo 进行了一些更改。现在如何在这个副本(尚未提交)和主分支的副本之间运行 git diff



git diff master:foo foo




$ b

在过去,它可能是:

git diff foo master:foo


I have a repo with file foo in the master branch. I switched to bar branch and made some changes to foo. How can I now run a git diff between this copy (which isn't committed yet) and the copy of the master branch?

解决方案

The following works for me:

git diff master:foo foo

In the past, it may have been:

git diff foo master:foo

这篇关于将文件的当前工作副本与另一个分支的提交副本进行比较的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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