1

Is there an easy way to delete all local files that svn status shows as ?, meaning new, not yet been added or checked in?

I do svn revert -R . to revert all the changed files but that doesn't do anything to the files that are new. I would like a 100% sync up with the repo, as though I completely checked everything out anew.

amphibient
  • 29,770
  • 54
  • 146
  • 240
  • 1
    You can: svn cleanup . --remove-unversioned See https://stackoverflow.com/questions/2803823/how-can-i-delete-all-unversioned-ignored-files-folders-in-my-working-copy – mjpirez Dec 01 '17 at 18:49

1 Answers1

2

The command you're looking for is svn cleanup. It accepts a few switches, but for what you're trying to do, which is deleting the unversioned files, you want to add the --remove-unversioned switch. This will delete all of the files under that directory that are not under version control.

svn cleanup /path/to/folder --remove-unversioned
Chris
  • 2,254
  • 8
  • 22
  • @amphibient Really? If you run `svn cleanup help` in the command line, do you see any available switches you can use? – Chris Dec 01 '17 at 19:18
  • @amphibient So I'm assuming you don't have subversion 1.9 if that's the case. If so, you might want to have a look at this answer: https://stackoverflow.com/questions/239340/automatically-remove-subversion-unversioned-files/239358#239358 – Chris Dec 01 '17 at 19:27