I used to do this a lot in Cornerstone when I was working with SVN. Select a single file and then view the log. It would show me only changesets that affected the selected file, so I could quickly find out when a change was introduced and the surrounding context.
I can't find any way to do this in SourceTree. I've tried using blame on the file, then opening the changeset for the line I'm interested in, but once I do this I can't find any way to go back further into the history. When the actual change I'm interested in wasn't introduced in the most recent change to that line (e.g. subsequent unrelated changes, or code style changes), it makes it difficult to step back any further and find the change I'm interested in.
Am I just missing something in SourceTree, or Git itself that?
If you go to the 'File Status' view and change the pulldown which selects which files are visible -- it's normally on 'Pending' – to 'All files, sorted by path', then you can see everything whether or not it has a pending change.
You can then right-click on a file and do 'Log Selected'.
(This works on the Mac, anyway... can't speak for Windows)
This is some odd terminology for the commit history of a file (like "Annotate Selected" for "Blame"), and I initially saw the option but did not click it because I thought it literally do what it said in some SourceTree way, like "write some kind of log thing for this file".
I'm coming from command-line and Git Extensions in Windows, and the latter follows the terminology closely to Git documentation and intuitiveness, but SourceTree seems to be making their own terms and phrases for common things.
I don't understand; am I missing something here? Is SourceTree doing it right and everyone else is wrong, or does it need to improve its terminology and intuitiveness?
I am using SourceTree 1.6.14 on Windows. I noticed the "Log Selected" feature only shows changes for the branch you are currently on. Not sure if I'm the only one who would like this feature, but is there (or will there be) a way to view changes of a single file that occurred on all branches as well? Basically the same as the SourceTree Log/History revision graph, but for a single file?
I'm not sure if I completely understand your solution, but I would like a full revision graph of a single file across ALL branches, not just the current branch I've currently checked out. I've tried your method, but after making a temporary change to the file and then performing "Log Selected" it still just s
I have the same issue. My use case is that:
I find and fix an issue in a current branch of work and realize that I want to put that change into production as a hotfix.
I create a branch from the tagged release and then want to view *all* the history of the affected file so that I can cherry-pick the change into the hotfix branch.
Currently (220.127.116.11) once I'm in my hotfix branch and 'log selected' the history of the affected file doesn't include from 'then' to 'now' which is required to allow me to identify and cherry-pick the relevant commit(s).
Right clicking on any file and selecting "Log Selected" is what you want to do.
But usually the challenge is to find a commit containing the file you want to track. The trick is to make a dummy edit to the file, and it'll show up in your Working Copy. From there you can right-click and log it (be sure to follow renames, since it seems to quickly get lost otherwise, even when no renames are involved, at least on the Windows version).
When you're done just revert your dummy change.
Sorry to all the guys at Atlassian who have to review these posts, but I too would love to see this feature. It would be my No 1 feature by a long way.
Best workaround I have found for anyone using Visual Studio is to enable Git as the source provider. It sits nicely alongside SourceTree (neither seems to upset the other), and viewing a file's history in Visual Studio is simply a right-click away. I use it all the time.
That's a good workaround Lawrence.
I think that what's missing with SourceTree is a control displaying the full working directory as it was at any given commit. Git Extensions does this (https://sourceforge.net/projects/gitextensions/). It's the killer feature that I would love to see SourceTree take on.
I'm using "Custom Action" to launch Git Extension File History feature to do this. It's better, but the revision graph doesn't show which branch the file belongs to. Have you, by any chance looked into how to figure out the originating branch of an individual file in the Git Extension File History revision graph?
Badges are a great way to show off community activity, whether you’re a newbie or a Champion.Learn more
Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs