How do I get a list of all unversioned files from SVN?

Sometimes you’re 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?

  • Push to remote branch failing after squashing local commits
  • In IntelliJ IDEA, how to add the same file to multiple version control systems?
  • Git:Why after Re-basing still my fork is behind the original repo master?
  • Set up a working copy under both Git and Svn version control
  • How to have Git highlight forked changes?
  • How to push only to a branch of my fork of a Github repo, after a pull request has already been made
  • Is it possible to do a partial clone/branch with either bazaar, mercurial or git?
  • How to effectively organize scripts so they can be put under version control?
  • 5 Solutions collect form web for “How do I get a list of all unversioned files from SVN?”

    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.

    If some files have had ‘ignore’ added to their status, they won’t show up in ‘svn status’. You’ll need:

    svn status --no-ignore
    

    If you’re running on Windows, you could do something similar to Greg Hewgill’s answer 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!

    Or from the Windows command line:

    svn stat | find "?"
    

    You can use this command to list all paths for not-versioned files:

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

    The first part will do an svn status, and then it will redirect the output to AWK which will do simple filter “first character should be ‘?'” then it will print the second parameter “which is the file path”.

    svn status will always not print ignored files. You can add a file or path by adding that path using

    svn propset svn:ignore "PATH OR PATERN"
    
    Git Baby is a git and github fan, let's start git clone.