Git show to view previous version of renamed file?

We renamed the file where it git log --follow my/new-filecorrectly shows the changes before and after renaming.

But this does not work, to show the previous version git show <rev>:my/new-file.

We need to run git show <rev>:my/old-file.

Can I run this command with my / new file instead of my / old file?

+4
source share
1 answer

The short answer is simple if you don't like it: no.

, git show , ( git rev-parse, ), , git rev-parse , , diff (-), , , .

git log --follow, , : (-), diff , diff , , , my/new-file my/old-file . , my/old-file.

Git , , ( git log), , , , git, git show. : git show $(git whatwas HEAD <rev> my/new-file) - ( git whatwas). script, whatwas , . , , .

+3

Source: https://habr.com/ru/post/1617492/


All Articles