How do I do "blame" on a file in SourceTree
Asked by Tom Quarendon:

A very common operation that I want to do is work out how a file got to the state it is, who is responsible for that ghastly piece of code.

However I can find no way of doing this in SourceTree (Windows version 1.3.1.0).

Since it has no normal tree view of the working copy I can't just find the file, right click and say "blame" like I would expect.

I've naively tried using the search tab and typing in the source name and selecting the "File Changes" from the search type drop down. However it just sits forever thinking.

Is there a way to do what I want?

Thanks.


Answers:
author: Tom Quarendon
body: Seems like you can't


author: Jeff Thomas
body: There is a "Blame Selected" option when right-click on a file (if you can find it). I think your first problem is trying to figure out why searching hangs. Does it do this with every repository or just this one?

comments: author: PatrikGrmanAnritsu
body: Where is the Blame Selected option?

I found my file under Working copy and the only "\<something\> Selected" options I can see are "Log" and "Annotate"

Yes I know this is over 5 year old thread, but this is where search got me.


author: Jed Lund
body: Annotate = Blame (Sourcetree translation)

<https://community.atlassian.com/t5/Sourcetree-questions/Was-blame-removed-from-source-tree-Or-where-did-it-move-to/qaq-p/763394>


author: Chris Loverich
body: ![](../../../upfiles/Screen_Shot_2014-03-06_at_2.18.39_PM.png)

The problem is the default view is only for modified files - however \*you can change the view to show all files\*. Its just as bit cludgy.

First, change the view to "File Status View" (on OSX, View --\> File Status View)

Then, there is a selection menu on the actual app. Hard to describe, but its a menu bar beneath the icons menu bar, grouped with a few others:

Flat View \| Tree View \|\| Column View \| \*Show ... \*

The "Show" selection can be changed to "Show All" - when I set mine, it was on "Show Modified"

Would probaly make more sense to have that option in the View menu proper.

comments: author: Damian ?dbirdz? Vogel
body: This description is pure gold! If I was missing one thing, it was the tree view, you have just boosted the usefulness of this application by a 150%!


author: Tom Quarendon
body: By "If you can find it", presumably you mean "if you can find the file somewhere in the user interface to have something to click on". And that's the basic issue. I know where the file is in my source tree, I just can't get an object anywhere in the UI to represent it, to have a context menu to select "blame selected" on. The only way I know is if I can find *some* commit under which it has changed, but almost by definition I don't know that in this scenario.

I'm not even sure "search file changes" is what I want. I've just tried on another repository cloned off an open source project and what I get in "Search: File changes" is, well I don't know what to be honest. It's a bunch of descriptions, dates, authors and commit hashes, but it's unclear to what files they relate. If I pick one, the files under the commit details aren't anything related to the term I put in the search dialog. Ahh. The *diff* to one of the files does contain the text I searched for. OK clever, but actually not at all what I'm after. Can't actually think of a scenario in which I'd want that. Now a "search the names of files in the working copy" would be a useful feature.

Perhaps our repository is just too big for the search? It's not small, but it's hardly enormous.

This is such a basic requirement to me that I'm surprised it's so hard. There must be a way of doing a blame or a log on an arbitrary file. I can do it simply using the git-gui windows integration, but I was hoping for a single gui, rather than using git-gui for some things and SourceTree (or something else) for others.

comments: author: Jeff Thomas
body: You're right, I tried using the Search file changes and couldn't easily find the file I wanted. Unfortunately, I don't know of a better way to search in SourceTree. Hopefully someone else can comment.