Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to revert files with specific extension in svn?

Tags:

file

revert

svn

I would like to do something like this:

svn revert --recursive mydata/*/*.txt

and I want it to revert all files which have extension *.txt in the directory mydata. Is there a way to do that?

like image 865
Paulius Liekis Avatar asked Dec 29 '22 07:12

Paulius Liekis


1 Answers

On a POSIX-compatible OS (Linux/Mac/Cygwin):

find mydata -mindepth 2 -name \*.txt | xargs svn revert

On Windows (use %%G in a batch file, %G on the command line):

FOR /R mydata %G IN (*.txt) DO svn revert "%G"

Strictly speaking, the Windows command will affect mydata/*.txt, mydata/*/*.txt, mydata/*/*/*.txt, and so on, so maybe it's not exactly what you're looking for... but maybe it's enough to get you there.

like image 199
mrkj Avatar answered Jan 04 '23 17:01

mrkj