Собственно сабж, что бы нагляднее:
test % git init
Initialized empty Git repository in /home/asm/test/.git/
test % echo «asdf» > textfile
test % git add textfile
test % git commit -m"c1"
[master (root-commit) d6a80a6] c1
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 textfile
test % git checkout -b b
Switched to a new branch 'b'
test % git mv textfile textfile.txt
test % git commit . -m"c2"
[b 2f9d4e1] c2
1 files changed, 0 insertions(+), 0 deletions(-)
rename textfile => textfile.txt (100%)
test % git diff master | cat
diff --git a/textfile b/textfile
deleted file mode 100644
index 8bd6648..0000000
--- a/textfile
+++ /dev/null
@@ -1 +0,0 @@
-asdf
diff --git a/textfile.txt b/textfile.txt
new file mode 100644
index 0000000..8bd6648
--- /dev/null
+++ b/textfile.txt
@@ -0,0 +1 @@
+asdf
Получается, что это уже два разных файла.
Вопрос, можно ли как-то не очень извращённым способом получить diff этого файла? Как объяснить git-у что то один и тот же файл?