Sometimes I want to patch the staged file with deleted texts. It would be convenient if I can select and copy them.
If I understand your question correctly, you want to copy-paste text from a staged file using the diff view of SourceTree into another file or from a file into the staged file.
To copy from the diff view, simply select the text in the view and do a ctrl-C / ⌘-C and ctrl-V / ⌘-V it anywhere.
The copy command is also available from a right-click context menu once you have selected the text in the diff view.
As for modifying the staged file, you should probably be editing it in your primary editor. It will be updated and re-staged after you've saved the file in that editor and SourceTree senses the change.
You can use the git command line, or lunch the external diff tool from Sourcetree.
Thanks. The shortcuts works, though it only copies one entire line.
Because selecting in diff view is lame, it cannot choose just words or multiple lines.
Also, right-click context menu cannot appear in diff view.
Where can I issue a ticket for those function?
On Windows, you can select multiple lines, but selecting words or using right-click are not possible.
Thanks, It's not dragging to select, but with shift. Now I see.
But it is kind of buggy. If you select a line and click the lines under it with shift, that works fine, But clicking upward is weird, which will unselect your previous selection and select next line.
What program do you have configured as your external diff tool?
I can select a file and press cmd+D to have the selected and previous versions open in my text editor side by side in diff mode.
For older versions I can right click the file and "open selected version" to open the file at the state it was in for that commit.
It looks like you're new here. Sign in or register to get started.