0

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?

Forethinker
  • 3,548
  • 4
  • 27
  • 48

1 Answers1

2

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

git diff debug file.txt
William Seiti Mizuta
  • 7,669
  • 3
  • 31
  • 23