Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

blame

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?

like image 756
Slam Avatar asked Nov 12 '10 22:11

Slam


People also ask

How do I git blame on GitHub?

On GitHub.com, navigate to the main page of the repository. Click to open the file whose line history you want to view. In the upper-right corner of the file view, click Blame to open the blame view.

How do I blame in git?

The git blame command is used to examine the contents of a file line by line and see when each line was last modified and who the author of the modifications was. If there was a bug in code,use it to identify who cased it,then you can blame him. Git blame is get blame(d).

What does * mean in git blame?

Annotations for lines modified in the current revision, are marked with bold type and an asterisk. But I think it is important to clarify that this refers to lines modified in the current revision of the file, not the current revision of the repository.

How does git connect to remote repository?

To add a new remote, use the git remote add command on the terminal, in the directory your repository is stored at. The git remote add command takes two arguments: A unique remote name, for example, “my_awesome_new_remote_repo” A remote URL, which you can find on the Source sub-tab of your Git repo.


1 Answers

The following should work even in bare repositories:

git blame <rev> -- <path>

E.g.

git blame master -- README.txt
like image 102
earl Avatar answered Oct 05 '22 08:10

earl