Search code examples
gitblame

How can I 'git blame' on the remote-side repository?


On my server, I host my personal Git remote-side projects (with Gitosis), and I have built a web interface to browse the repositories (something like GitHub).

On the remote-side, you are not allowed to do a lot of stuff, because a working tree is missing, and this is correct: by the way, for a repository explorer, with few commands I can do almost everything.

Except for git blame.

How can I blame a file without a working tree, within the remote-side repository?


Solution

  • The following should work even in bare repositories:

    git blame <rev> -- <path>
    

    E.g.

    git blame master -- README.txt