Is there some way to commit a file “partially” in TortoiseSVN


I'd like to commit just a part of a file using TortoiseSVN, is there some way to do that?

I'll give an example to make it clearer why I want to do that.

I have a file with some defines that are replaced in the build process, something like this:


This [SOME_PATH] tag is replaced in the build process but when I'm coding I have to change it so the actual path in my machine.

So each time I commit I need to backup some lines, revert them, commit and then restore the backup, and this is kinda annoying.

Is there some way to tell TortoiseSVN to "ignore" some changes in, say, Lines X,Y and Z?

Best Solution

The top voted answer is out-of-date.

From the tortoiseSVN website:

Commit only parts of files

Sometimes you want to only commit parts of the changes you made to a file. Such a situation usually happens when you're working on something but then an urgent fix needs to be committed, and that fix happens to be in the same file you're working on.

right click on the file and use Context Menu → Restore after commit. This will create a copy of the file as it is. Then you can edit the file, e.g. in TortoiseMerge and undo all the changes you don't want to commit. After saving those changes you can commit the file.

After the commit is done, the copy of the file is restored automatically, and you have the file with all your modifications that were not committed back.