Stack Exchange Network
Stack Exchange network consists of 181 Q&A communities including
Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack Exchange
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this community
Anybody can ask a question
The best answers are voted up and rise to the top
9 years, 6 months ago
I want to copy my
c directory with all subdirectories excluding
./git subdirectory. I do it using
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 Sowa
rm -rf ~/Dropbox/Public/c/.git
Can I do it better?
77.8k 42 42 gold badges 164 164 silver badges 221 221 bronze badges
Nov 10, 2013 at 15:42
949 1 1 gold badge 7 7 silver badges 14 14 bronze badges
Just add an explicit exclude for .git:
rsync -a --exclude='.git/' --include='*.c' --include='*.sh' --include='*/' --exclude='*' ~/c/ ~/Dropbox/Public/c
Another option is to create
~/.cvsignore containing the following line along with any other directories you'd like to exclude:
Nov 10, 2013 at 15:47
976 7 7 silver badges 2 2 bronze badges
You can just use
rsync --cvs-exclude. It also ignores
But take care, that this also ignores directories called
core as occurring in Magento source files.
Jun 20, 2014 at 7:40
log in to answer this question.
Not the answer you're looking for? Browse other questions tagged
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our
Accept all cookies
Necessary cookies only