How to 'git blame' on the remote-side repository?

Slam picture Slam · Nov 12, 2010 · Viewed 7.8k times · Source

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: btw, for a repository explorer, with few commands I can do almost everything.

Except for git blame.

I'm not able to find out how to blame a file without a working tree, within the remote-side repository. Got you some ideas?

Answer

earl picture earl · Nov 13, 2010

The following should work even in bare repositories:

git blame <rev> -- <path>

E.g.

git blame master -- README.txt