Patrick Linskey
Patrick Linskey

Reputation: 1144

Git: how to show the diff from a point in history to the current working set?

How do I compute the diff between some point in my git commit history and my current working set?

git diff shows me the diff between my working set and HEAD.

git diff origin/master..HEAD shows me the diff between origin/master and HEAD.

I'd like to get the union of those two commands, all in one patch file. Is such a thing possible? Currently, I'm emulating it by creating two patch files, which is not satisfying.

Upvotes: 0

Views: 67

Answers (1)

mkasberg
mkasberg

Reputation: 17342

git diff abc123 will show you differences between your current working directory and the specified commit (abc123 in this case) (you can also use a branch name here).

From git help diff:

git diff [--options] <commit> [--] [<path>...]
       This form is to view the changes you have in your working tree 
       relative to the named <commit>. You can use HEAD to compare
       it with the latest commit, or a branch name to compare with the 
       tip of a different branch.

Upvotes: 2

Related Questions