If you’re like me in reusing entire application code bases to create new apps, you will run into this issue often: deleting .svn or .git directories from old applications so you can commit them to a new repository. Luckily, there are two easy command lines you can use to achieve this for either svn or git downloaded source code.
The Command Lines
You can use the below command lines to find .svn / .git folders in the current sub-directory, and then delete them so you can commit them to a new repository.
The command lines can also work for other directories. You can replace the
find . -name with
find /path/to/directory -name, and achieve the same result for a different directory.
Similarly, the code can also work for other folder types or files. You can replace the
.git in the command line with a name of your choice. For example, you can replace
*.php to find all PHP files in a given directory.