AegisRyan’s Island

More About Latest Tech News, Gadget, Trend



Copy folder/directory exclude hidden .svn folder (linux)

During work, every time when I want to create a new sub-project (which has similar folder structure with existing one) I need to create the folder one by one. I cannot just copy-paste the sub-project1 folder and renamed it to sub-project2 because it contains hidden .svn which is used to track the version of sub-project1.

project
- sub-proj1
- - src
- - - - main
- - - - - - java
- - - - - - resource
- - - - - - webapp
- - - - - test
- sub-proj2
- - - - main
- - - - - - java
- - - - - - resource
- - - - - - webapp
- - - - - test

So… how do I get rid of hidden .svn folder/files when copying from sub-project1 to a new sub-project?

rsync -r --exclude=.svn SRC_FOLDER DESTINATION FOLDER

example:

rsync -r --exclude=.svn /root/project/sub-proj1/ /root/project/sub-proj2/

Hope this would help!

bookmark:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Blogosphere News







Leave a Reply