user291701
user291701

Reputation: 39671

Get a diff of a file in two different branches

I have two branches A, and B. (they're both remote branches too). Is there a way to do a diff of a single file between the two branches? It's located in the same place in both branches etc.

Upvotes: 1

Views: 220

Answers (2)

Lazy Badger
Lazy Badger

Reputation: 97270

git diff A:File..B:File

Git Reference (abot git diff), Git Community Book, "git - compare branches" for details

Upvotes: -1

ksol
ksol

Reputation: 12235

I use git diff branch1 branch2 -- <File1>[, <File2>...] to achieve this.

Upvotes: 4

Related Questions