View Single Post
Old 28th December 2020, 16:13   #2  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Quote:
Does anyone know a GUI tool which allows me to decide which changes in a diff patch I want to apply to my local working directory?
Not exactly. But the following workflow is possible:

Suppose you have a local GIT repo in "clean" state and then you manually apply some patch via "patch" command to your working directory. Now, if after applying the patch you run "Git Commit" via TortoiseGit (e.g. from Explorer context menu), this will open the Commit window and show you a list of all files that have been changed (by the patch). If you double-click any of the modified files, it will open the TortoiseGitMerge window and show you all individual changes in that file. Here you can selectively undo any changes you don't want: Just right-click the changed lines that you want to revert, on the right ("Working Tree") side, and choose command "Use other text block" from the context menu. This will restore the original lines.

Don't forget to save in TortoiseGitMerge. Once you have reverted any changes you didn't want to have, you can proceed with the commit. And then you can even "export" your commit as a new .diff file containing only the desired changes.
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 28th December 2020 at 16:27.
LoRd_MuldeR is offline   Reply With Quote