I checked out a specific revision of a repository with git checkout
after git clone
(git tells me that I have a detached head, if that is important).Now, this revision doesn't compile completely. It looks like some refactoring was only done partially, and I need to see what changes have been done later.
I've tried
git diff origin/master -- path/to/file
but that treated my file as completely new. I get a diff like:
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
new file mode 100644
index 0000000..19e1244
--- /dev/null
+++ b/drivers/usb/core/driver.c
(complete contents of the file follows)
which doesn't help me at all. I've also tried variations of git log
with no success.
Ideally, I'd like to see all diffs of changes made to the file at later dates (compared to what I have in my working copy). Once I've found interesting ones, I'd like to look at all the changes made in the specific revisions.
Note: Just checking out a later revision or branch wouldn't work in my case. The project uses different branches for different devices, and I've already got the latest commit for the device I'm working on. There are newer commits where the refactoring is complete, but they don't have all the device specific stuff I need.