I want to copy my c directory with all subdirectories excluding ./git subdirectory. I do it using rsync :echo copy c and sh files rsync -a --include='*.c' --include='*.sh' --include='*/' --exclude='*' ~/c/ ~/Dropbox/Public/c# remove .git directory = do not send it to dropbox. Thx to Tomasz Sowarm -rf ~/Dropbox/Public/c/.gitCan I do it better?
How to use rsync to backup a directory without git subdirectory
rsync;git;dropbox
Just add an explicit exclude for .git:rsync -a --exclude='.git/' --include='*.c' --include='*.sh' --include='*/' --exclude='*' ~/c/ ~/Dropbox/Public/cAnother option is to create ~/.cvsignore containing the following line along with any other directories you'd like to exclude:.git/