Friday, December 26, 2008

How to commit only needed files in svn

Sometimes I want to commit only several files using svn (subversion) command line.

What is the best way? I use this one.

First of all I see the status of my svn repository:
svn status
If I see ? mark at the start of the line, I then decide should I add (svn add dir/filename) or delete or whatever.

Later I do as follows:
svn status | cut -c8- > out.txt
What this does it deletes first 8 characters and dumps svn status to file. I then edit this file via some editor deleting lines I don't need.

And then I execute the following command, which would commit only those files present in out.txt
svn ci --targets out.txt --username USER -m Commit_message