How to get a list of all untranslated files from SVN?

Sometimes you evolve and you decide to commit, forgetting that you created several files in your project. Then, a few days after your companion receives your assembly from Subversion and complains that some files seem to be missing. You understand, ah, I forgot to add these files!

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

+68
version-control svn
Oct. 19 '08 at 5:25
source share
5 answers

Use the svn status :

 svn status | grep ^? 

Files that are not versions are indicated by? at the beginning of the line.

If you find that you always have certain files that cannot be added to the repository (for example, generated binary files), you should configure svn:ignore in the containing directory so that these files are not displayed when using svn status .

+91
Oct 19 '08 at 5:26
source share

If some files have "ignore" added to their status, they will not be displayed in the "svn" status. You will need:

 svn status --no-ignore 
+36
Aug 29 '11 at 2:05 a.m.
source share

If you are running Windows, you can do something similar to Greg Hewgill using PowerShell.

 (svn stat) -match '^\?' 

This could be fairly easily expanded to find all unversioned and ignored files and delete them.

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

Hope this helps someone!

+15
Jul 04 '09 at 12:42
source share

Or from the Windows command line:

 svn stat | find "?" 
+9
Nov 26 '12 at 17:05
source share

You can use this command to list all paths for files without versions:

 svn status | awk '/^?/ {print $2}' 

The first part will do svn status , and then redirect the output to AWK , which will make a simple "first character should be" filter? ", then it will print the second parameter" file path ".

svn status will never print ignored files. You can add a file or path by adding this path using

 svn propset svn:ignore "PATH OR PATERN" 
0
Sep 25 '15 at 11:00
source share



All Articles