Is there a way in SourceTree to compare one given file between two branches?
Using a command line, it would be:
git diff <one_branch> <another_branch> <my_file>
You can select any two commits (using CNTRL-click or CMD-click) to do a diff between them. The just select the file from the list in the lower left corner that you want to see the differences on.
There is no way to do this form the SourceTree UI.
The closest you can get to this: You can use the "Log selected" option from the context menu that comes up when right-clicking a file name to display the history of the file in the current branch. Within this, if you select two states, it gives you a diff between them. Unfortunately, this only works within one branch.
Thanks for your quick answer. Generally speaking, I really miss in SourceTree a "Diff..." menu, allowing to compare the selected file to another commit/tag/branch of that file.
The same thing seems to work between branches as well in the File history window of Git Extensions.
Yes, this is what I was looking for. Thanks.
yes: Please!
i am switching from cornerstone (svn) to sourcetree. what i really miss is an easy way to compare two versions of a file. cornerstone has a really great history/log view even on a single file.
markus
but this only compares to the last checked out/working version, or do i miss something?
If you use Control-click (or Command-click) on a Mac, you can select any two arbitrary commits and it compares between them.
See my accepted answer above - you can easily do this by selecting two commits at thes ame time (using CNTRL-click or CMD-click) and then selecting the file you are interested in in the lower left corner file listing.
your are right. that works. i must have missing something with my first tests. thank you
It looks like you're new here. Sign in or register to get started.