Information Technology Reference
In-Depth Information
three
four
five
six
seven
eight
The
3,4
tells us that the second version of the file starts at line
3
and consists of
4
lines:
three
foo
bar
eight
and
HEAD
to compare different revisions. In similar way you can compare different
branches:
$ git diff master dev
and the files stored in different branches:
$ git diff master dev -- some-file
By default,
$ git diff
compares lines. You also can change its behavior to
search for changed words. This can be done with:
$ git diff --word-diff
And if you want to find the revisions in which a given file
some-file
was modi-
fied you can use both:
$ git diff --name-only master dev -- some-file
and
$ git log --name-only master dev -- some-file