Tuesday, March 13, 2012

Remove SVN, Add SVN in Linux



There are times we just want to copy the source files and add it to SVN. The problem is, if we copy the whole folder, we also copy the SVN link. You could remove the ".svn" one by one, but then again, that would be REALLY tedious.




So here's the trick:

Run this command, just to check there really is svn in that folder:
find . -name .svn -exec ls {} \;

And this command will delete your svn problem!
find . -name .svn -exec rm -rf {} \;

Don't worry, it will only remove the svn within the folder you are into. =)

So, now that you have removed it, you might want to add again to SVN in a different path. Here's what to do:
  • Get your SVN path by using this command at an existing svn folder
    svn info
    Or to be more accurate use this command to see the current files at that SVN path
    svn ls <svn pathname>
  • Use this command to create a folder at SVN
    svn mkdir <svn pathname>/<folder name> -m "<message>"
  • Lastly, use this command to copy your source files to SVN
    svn import <folder of source files> <svn pathname>/<folder name> -m "<message>"
Resources:
How to remove all SVN directoris from my app

No comments:

Post a Comment