Question

I have set vim as the svn editor.

Now, whenever I do 'svn ci', it opens up vim editor allowing me to enter the commit comments. Below the comment section, there are set files which will be checked in. So, If I don't want certain files to be committed, I remove it from the list of files in the vim editor. But when I save and quit the vim editor, svn still checks-in the file I have removed in the editor.

Is this expected behavior? Or I need to set something in the svn configuration to make it work?

Was it helpful?

Solution

That list of files in the comments section is... well... just comments. It doesn't really do anything - it's just there to help you by letting you see what you are committing.

If you want to not commit certain files, you have to do it beforehand:

  • You can specify the files you want commit in the svn commit command instead of committing everything.
  • You can add the ignored files to your svn:ignore property.
  • You can use some GUI tool that'll let you visually select what to commit and what not.
  • There is some trick with changelists. Haven't tested it(I don't use SVN since it's crap), just found it in this answer when I googled.
  • Use Git with git-svn, and simply git reset HEAD the files you don't want to commit to unstage them.

OTHER TIPS

The list in the editor is just informative; it tells you what will be committed but does not influence what will actually be committed (the relationship is the other way round). If that's not what you wanted, you have to kill the svn ci (typically by doing Ctrl+Z and then issuing the kill at the command line). To change what is committed, you need to list the files explicitly to svn ci; it only defaults to all known, modified files (i.e., those listed when you run svn status).

If the above way of working isn't to your taste, you might be better off getting one of the many GUIs that wrap around SVN. They almost universally make interactively selecting what to commit easier.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top