I rename some files with git mv. Normally git status would detect this and display that these files were renamed. However in GitWeb these files are displayed as deleted and created with new name. Is there a way to tell GitWeb to try to detect renamed files? Maybe, some other web-based Git viewer can do this?
Display renamed files in GitWeb
113 Views Asked by Michael Ivko At
1
Git doesn't track renames. It actually treats the following two operations in exactly the same way:
git mv foo barcp foo bargit rm foogit add barSome tools will display something along the lines of "
foorenamed tobar", but it's just a guess based on similar content. Other tools will display "deletedfooand addedbar". To Git they're the same thing.The
gitweb.confmanpage lists a configuration directive that can be used to change how renames are detected:It looks like the default value of
('-M')is what you want (from thegit-diffmanpage):Perhaps the files you're comparing also have enough different content that they are not being detected as a rename?