0 votes
1 view
in Devops and Agile by (28.1k points)
edited by

How do you make git diff only show the difference between two commits, excluding the other commits in-between?

2 Answers

0 votes
by (48k points)

Just pass the below commands to see the diff between two commands without having the commits in between

git diff <commit_id1> <commit_id2> > <name>

git apply <name>

This will show you the difference but without the commits in between

For example: 

git diff 0da94be  59ff30c > my.patch

git apply my.patch

0 votes
by (63.4k points)

Use can use the following:

git diff <a-commit> <another-commit> path


git diff commit1 commit2 config/routes.rb

It will show the difference between that file between those commits.

Related questions

0 votes
1 answer
0 votes
1 answer
asked Jul 25, 2019 in Devops and Agile by chandra (28.1k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers !