Thursday, 15 March 2012

What interpretations of a change are supported by git commands? -



What interpretations of a change are supported by git commands? -

i understand git tracks changes of project whole instead of particular files. leads me next question.

can utilize git commands apply different interpretations of change?

i might asking "which commit lastly modified particular line?" or "which commit modified line's content not removed identical content somewhere else?".

what interpretations can out of box , how? default?

i sense fact git tracking project whole misunderstood. means that

a commit, reproducible snapshot, refers whole project git not store individual file histories in separate files rcs

but git still stores info in file-size units, called blob objects. blob contents of file @ time, detached name, stored in tree object.

an implication of storage method file renames not (always) explicit implied:

git mv foo.c bar.c cp foo.c bar.c; git add together bar.c; git rm foo.c

the 2 lines above result in same git status output:

renamed: foo.c -> bar.c

git detects identical blob object referred under different name in tree object.

finally, @andrewc pointed out, git log has options follow content.

git log --follow <single-file> # print history of file, next renames git log -s string # show commits occurrence number of string has changed git log -g string # show commits diff contains string

git

No comments:

Post a Comment