Why does git log with --follow and --reverse return only last commit?

后端 未结 1 1663
野趣味
野趣味 2021-02-08 10:15

I wanted to view all the commits of a file from the beginning in reverse I ran

git log --reverse [file]

And it worked as expected. but for a

1条回答
  •  余生分开走
    2021-02-08 10:41

    This seems to be known bug in git. The only work around I can see is if you know what the file was named before, pass it along with the current file to the command, i.e.

     git log --reverse --follow -- oldfilename currentfilename
    

    Edit: the following will do what you want:

    git log --name-only --pretty="format:"  --follow  | sort -u | xargs git log --reverse --
    

    0 讨论(0)
提交回复
热议问题