views:

1206

answers:

2

Sometimes youre developing and you decide to commit, forgetting you created a few files on your project. Then a few days down the line your buddy gets your build out of subversion and complains that some files appear to be missing. You realize, ah crap, I forgot to add those files!

How can I get a list of the files that are not under version control from subversion so I'm sure I've added everything to the repository?

+11  A: 

Use the svn status command:

svn status | grep ^?

Files that are not versioned are indicated with a ? at the start of the line.

If you find that you always have some specific files that should not be added to the repository (for example, generated binaries), you should set up the svn:ignore property on the containing directory so these files won't keep showing up when using svn status.

Greg Hewgill
Personally, I always "svn diff" before "svn ci", but since that's slow sometimes, I always "svn stat" before "svn diff", which is handy because then I don't forget to add stuff :)
ephemient
+1  A: 

If you're running on Windows, you could do something similar using PowerShell.

(svn stat) -match '^\?'

This could be extended pretty easily to find all unversioned and ignored files and delete them.

(svn stat "--no-ignore") -match '^[I?]' -replace '^.\s+','' | rm

Hope that's helpful to someone!

Damian Powell