Question

I have a modified file on my current working directory called file.txt. I want to compare it with a version of it on debug branch. The following command does not work:

git diff file.txt debug:file.txt

fatal: Path 'file.txt' exists on disk, but not in 'debug'

How can I compare them? Do I have to commit first?

Was it helpful?

Solution

Use the following command to compare file.txt from current branch to debug branch:

git diff debug file.txt
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top