Skip to main content
added 33 characters in body
Source Link
Romain Valeri
  • 22.8k
  • 3
  • 52
  • 76

Off-topic answer -- see commentsdiffing the same file in different branches

Just to add it for I find it a very straightforward syntax :

git diff <branch1> <branch2> <filepath> 

Also works with relative refs like for example :

# compare the previous committed state from HEAD with the state branch1 was 3 commits ago git diff HEAD^ <branch1>~3 <filepath> 

Off-topic answer -- see comments

Just to add it for I find it a very straightforward syntax :

git diff <branch1> <branch2> <filepath> 

Also works with relative refs like for example :

# compare the previous committed state from HEAD with the state branch1 was 3 commits ago git diff HEAD^ <branch1>~3 <filepath> 

Off-topic answer -- diffing the same file in different branches

Just to add it for I find it a very straightforward syntax :

git diff <branch1> <branch2> <filepath> 

Also works with relative refs like for example :

# compare the previous committed state from HEAD with the state branch1 was 3 commits ago git diff HEAD^ <branch1>~3 <filepath> 
added 40 characters in body
Source Link
Romain Valeri
  • 22.8k
  • 3
  • 52
  • 76

Off-topic answer -- see comments

Just to add it for I find it a very straightforward syntax :

git diff <branch1> <branch2> <filepath> 

Also works with relative refs like for example :

# compare the previous committed state from HEAD with the state branch1 was 3 commits ago git diff HEAD^ <branch1>~3 <filepath> 

Just to add it for I find it a very straightforward syntax :

git diff <branch1> <branch2> <filepath> 

Also works with relative refs like for example :

# compare the previous committed state from HEAD with the state branch1 was 3 commits ago git diff HEAD^ <branch1>~3 <filepath> 

Off-topic answer -- see comments

Just to add it for I find it a very straightforward syntax :

git diff <branch1> <branch2> <filepath> 

Also works with relative refs like for example :

# compare the previous committed state from HEAD with the state branch1 was 3 commits ago git diff HEAD^ <branch1>~3 <filepath> 
Source Link
Romain Valeri
  • 22.8k
  • 3
  • 52
  • 76

Just to add it for I find it a very straightforward syntax :

git diff <branch1> <branch2> <filepath> 

Also works with relative refs like for example :

# compare the previous committed state from HEAD with the state branch1 was 3 commits ago git diff HEAD^ <branch1>~3 <filepath>